what's the best way to combine multiple pics into one big pics
what's the best way to combine multiple pics into one big pics
Hey, I need to generate one big by combine around 20 small pics
each small pics I have its location(offset x, y) and I have the big image size
what is the best command to do with it?
if I used in java, is there any example to take a look?
each small pics I have its location(offset x, y) and I have the big image size
what is the best command to do with it?
if I used in java, is there any example to take a look?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: what's the best way to combine multiple pics into one big pics
What you probably want is to flatten all the images onto the background. You can do that in one command line using -flatten. See https://imagemagick.org/Usage/layers/#flatten. Sorry, I do not know the Java ImageMagick API nor do I know of any Java examples. See https://github.com/techblue/jmagick or search on Google or StackOverflow.
Re: what's the best way to combine multiple pics into one big pics
Hi,
I follow this command, but the issue I face is the background of image is white or something else, do you know how to setup background as transparent, and only keep the images I want to combine
I follow this command, but the issue I face is the background of image is white or something else, do you know how to setup background as transparent, and only keep the images I want to combine
Re: what's the best way to combine multiple pics into one big pics
the command generated is : convert -size 1990x3535 xc:transparent -page +0+0 image1.png -page +497+0 image2.png -layers flatten image3.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: what's the best way to combine multiple pics into one big pics
Insert "-background None" before "-layers flatten".
snibgo's IM pages: im.snibgo.com
Re: what's the best way to combine multiple pics into one big pics
works! thank you! do you know why I need to have this "xc:transparent" in the cmd, looks like without this, it won't work
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: what's the best way to combine multiple pics into one big pics
It sets the limits/size of your output. You can remove it, but if your images are smaller, then you would get a smaller output. If your images are larger, then they will be clipped to those bounds.
Re: what's the best way to combine multiple pics into one big pics
got it, thank you!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: what's the best way to combine multiple pics into one big pics
You could remove the xc:transparent and use -layers mosaic. It will expand the canvas to so that all your images show. See https://imagemagick.org/Usage/layers/#layers
Re: what's the best way to combine multiple pics into one big pics
but my use case for now is I need to set a default image size for the whole image, so I need to keep xc:transparent right?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: what's the best way to combine multiple pics into one big pics
Yes, I believe that would be so, if you need a particular size. I was just trying to reply to your question and explain your options.