In Swedish sawmills, about 70% of the total costs can be derived from raw-material costs. Hence, it is very important for sawmills to obtain the highest possible yield. The green target size is an important parameter that affects the yield. The nominal size, sawing allowance, shrinkage allowance and planer allowance add up to the green target size that is needed when sawing lumber. We have, in this work, studied whether it is possible to adaptively control the green target size by measuring log density and annual ring width with an X-ray Log Scanner online. Our hypothesis was that density and growth speed will affect how much every single piece of lumber will shrink.The results show that both density and annual ring width are rather weak variables for prediction of lumber shrinkage. The variable "distance to pith", i.e., where in the log cross-section a piece of lumber has been cut, has proved to be a significant variable for prediction of lumber shrinkage. The results show that the yield can be considerably improved by adapting the green target size to how far from the pith every piece of lumber is cut.