I've been having trouble arranging graphic elements correctly. Here's an example:
im1 = Import["http://upload.wikimedia.org/wikipedia/commons/5/5c/London_2010_Tower_Bridge.jpg"];
GraphicsRow[{im1, ImageAdd[im1, Graphics[Disk[]]], Graphics[Disk[]]}]
The circles are both specified in the same way, but show at different scales, so the diagram that attempts to show how it works isn't very satisfactory. Obviously one is scaled to match the image, but I can't see why they don't appear the same size. Row
is similar to GraphicsRow
but gives me the same problem.
The Photo Compress app available at Google Play does the same thing for Android users. Download the app and launch it. Select the photos to compress and adjust the size by choosing Resize Image. Be sure to keep the aspect ratio on so the resizing doesn't distort the height or width of the photo.
The problem occurs because in the display, the disk used in the mask has a diameter equal to the height of the image, whereas the stand-alone disk has a diameter equal to the width of the image. You can correct this by specifying the size of the disk explicitly.
im1 = Import[
"http://upload.wikimedia.org/wikipedia/commons/5/5c/London_2010_\
Tower_Bridge.jpg"];
disk = Graphics[Disk[], ImageSize -> ImageDimensions@im1];
GraphicsRow[{im1, ImageAdd[im1, disk], disk}, Spacings -> 0, ImageSize -> Full]
Another option would be to wrap the images in a Pane
with automatic width and fixed height, e.g.
Row[Pane[#, {Automatic, 200}] & /@
{im1, ImageAdd[im1, Graphics[Disk[]]], Graphics[Disk[]]}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With