How compose two or three jpg files to one new file

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Locked
wangyongjun
Posts: 36
Joined: 2019-10-23T02:01:57-07:00
Authentication code: 1152

How compose two or three jpg files to one new file

Post by wangyongjun »

Use A jpg as base. Specified param like x y position for B jpg on A
most important , A and B both 300 dpi . hope new file also 300 dpi

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How compose two or three jpg files to one new file

Post by snibgo »

Your question is vague. Perhaps this does what you want:

Code: Select all

magick A.jpg B.jpg -geometry +10+20 -composite out.jpg
snibgo's IM pages: im.snibgo.com

wangyongjun
Posts: 36
Joined: 2019-10-23T02:01:57-07:00
Authentication code: 1152

Re: How compose two or three jpg files to one new file

Post by wangyongjun »

Thanks for reply. It's work but has a problem.
B.jpg was painted on A.jpg. but B.jpg(in out.jpg)'s color is changed

wangyongjun
Posts: 36
Joined: 2019-10-23T02:01:57-07:00
Authentication code: 1152

Re: How compose two or three jpg files to one new file

Post by wangyongjun »

B's Color Mode is RGB and A’s is CMYK. Maybe this is the reason

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How compose two or three jpg files to one new file

Post by snibgo »

Yes. Decide what you want for the output, RGB or CMYK, and change one of the inputs to match the other.
snibgo's IM pages: im.snibgo.com

wangyongjun
Posts: 36
Joined: 2019-10-23T02:01:57-07:00
Authentication code: 1152

Re: How compose two or three jpg files to one new file

Post by wangyongjun »

when composite B.jpg on A.jpg bottom colors of two pics are different.
how make B's bottom color transparent for A

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How compose two or three jpg files to one new file

Post by snibgo »

What version of IM, on what platform? Please link to sample inputs.

I'm not sure what you want. Perhaps "-transparent {colour}" applied to just one of the inputs.
snibgo's IM pages: im.snibgo.com

wangyongjun
Posts: 36
Joined: 2019-10-23T02:01:57-07:00
Authentication code: 1152

Re: How compose two or three jpg files to one new file

Post by wangyongjun »


snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How compose two or three jpg files to one new file

Post by snibgo »

I suggest you use "convert", not "composite".

The inputs are both CMYK. For the second input, we make white pixels (#000) transparent. Windows BAT syntax.

Code: Select all

convert ^
  415.jpg ^
  ( 415-03.jpg -fuzz 5%% -transparent #000 ) ^
  -composite ^
  out.jpg
snibgo's IM pages: im.snibgo.com

Locked