Message Boards Message Boards

0
|
2082 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Position three images in a row, and add a rectangle between them

Posted 2 years ago

I have the three attached images. (Actually three pdf pages exported to png files, image for each page).

I want to create out of these three the following png image:

enter image description here

So first import the files:

im1 = Import["/Users/username/Downloads/threepages-1.png"]
im2 = Import["/Users/username/Downloads/threepages-2.png"]
im3 = Import["/Users/username/Downloads/threepages-3.png"]

Now I tried

Export[
 "/Users/username/Downloads/output.png",
 Row[{im1, im2, im3}]
 ]

But the output image is very small in size. Why is that?

Furthermore, How can I add some 10 pixels of Gray color between each image?

Attachment

Attachment

Attachment

POSTED BY: Ehud Behar
3 Replies
Posted 2 years ago

You can also experiment with Grid.

images = Import /@ FileNames["~/Downloads/threepages-*.png"];

(* The images have large white borders, remove if you want *)
cropped = ImageCrop /@ images;

imageRow = Grid[{cropped},
  Alignment -> Top,
  Background -> Lighter[Gray, 0.5],
  Spacings -> .5]

enter image description here

Experiment with the ImageSize and ImageResolution options for Export to get the result you need.

POSTED BY: Rohit Namjoshi
Posted 2 years ago

POSTED BY: Eric Rimbey
Posted 2 years ago

Very nice. You are using some functions I wasn't aware of and should certainly be. Thanks.

POSTED BY: Ehud Behar
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract