Can anyone explain why Row
and Grid
don't size the image correctly and consistently to 300
as specified in ImageResize
?
image = ImageResize[Import["ExampleData/lena.tif"], 300];
image
Row[{image}]
Grid[{{image}}]
Row[{"abcd", image}]
Grid[{{"abcd", image}}]
GraphicsGrid
doesn't seem to help either.
Any workarounds to do so?
Answer
Another approach (from this answer) is to re-set the value of the option ImageSizeMultipliers
to {1.,1.}
:
image = ImageResize[Import["ExampleData/lena.tif"], 250];
image2 = ImageResize[ExampleData[{"TestImage", "Mandrill"}], 150];
With the default settings
image
image2
Grid[{{"abcd", image, image2}}]
gives
After evaluating
SetOptions[EvaluationNotebook[], ImageSizeMultipliers -> {1., 1.}]
anywhere in the notebook, we get
You can reset the option value to its default using:
SetOptions[EvaluationNotebook[], ImageSizeMultipliers -> {.5, .25}]
An alternative, more cumbersome, approach is to wrap each object with Style[#, ImageSizeMultipliers->{1.,1.}
:
dontResizeF = Style[#, ImageSizeMultipliers -> {1., 1.}] &;
image
image2
Grid[{{"abcd", dontResizeF@image, dontResizeF@image2}}]
Comments
Post a Comment