Based on:
Best is scaling determined by width. For example, fixed width is 1000, then image whose width is less that 1000 will keep the actual size, and image whose width is 1200 will be adjusted to 1000, the ratio width/height is the same to that of the original image.
I believe you may use simply:
$PrePrint = # /. i_Image :> Image[i, ImageSize -> 777] &;
This way images in output are automatically scaled to a fixed width (here 777), and only output is affected. That is, if you define:
img = Import["ExampleData/lena.tif"]
The data assigned to img
is unchanged, but the output is displayed at the width specified. (If you copy and paste the output the the fixed size is included in that object.)
CellEvaluationFunction
. $\endgroup$auto-adjust
, that would be the simplest way. $\endgroup$CellPrint[ExpressionCell[Rasterize@x,"Input",CellEvaluationFunction->(ImageCrop@ImagePad[ImageResize[ToExpression[#],100],20]&)]]
$\endgroup$CellEvaluationFunction
options. $\endgroup$