SOLVED - Stamping Image Ontop Of Other Images

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?".
Post Reply
mr_hunter
Posts: 16
Joined: 2015-12-09T08:45:47-07:00
Authentication code: 1151

SOLVED - Stamping Image Ontop Of Other Images

Post by mr_hunter »

Hi there,
I'm very new (2 days experience) to this great tool so I apologise if this is simple. I've googled a lot to resolve it!

I'm trying to create a tool which will stamp a semi-transparent colour label on top of images which may be B&W, greyscale or colour of varying depths. When I use the code below it works for colour images ok, but for B&W it dithers it (unreadable) and for greyscale it is so faded it can't be seen. Here is the code:-

convert 13.tif label1.gif -set colorspace sRGB -gravity northwest -geometry +3+3 ^
-define compose:args=40,100 -compose dissolve -composite result.tif
convert result.tif result13.pdf

Thanks for any assistance,

Hunter
Last edited by mr_hunter on 2015-12-13T13:41:37-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Stamping Image Ontop Of Other Images

Post by fmw42 »

What version of Imagemagick are you using?

Try

Code: Select all

convert 13.tif label1.gif -colorspace sRGB -gravity northwest -geometry +3+3 ^
-define compose:args=40,100 -compose dissolve -composite result.tif
Why do you copy the output to a different name? Why not just use the final name in this line of code?

Can you post your input images to some place such as dropbox.com and put the URLs here?
mr_hunter
Posts: 16
Joined: 2015-12-09T08:45:47-07:00
Authentication code: 1151

Re: Stamping Image Ontop Of Other Images

Post by mr_hunter »

Hi there,
Thanks for the reply. Sorry for the delay - I was expecting the forum to email me notification of any replies.

I've tried what you sent and sadly it didn't work. I'm using ImageMagick-6.9.2-8-portable-Q16-x64.

I'll reply soon with a copy of the example images.

Thanks for your help!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Stamping Image Ontop Of Other Images

Post by fmw42 »

It should have notified you if you set your post or profile to send you email. Perhaps it went to your spam directory or was filtered to trash.

What does not work about the result?

An example with input images and what you expect for the output (at least a description) would be helpful.

If the image is already semi-transparent, then you could just use -compose over -composite, since the semi-transparency would act as the blending factor.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Stamping Image Ontop Of Other Images

Post by fmw42 »

There seems to be a bug with bilevel tiff input. It works if you convert your 2.tif to 2.png.

Code: Select all

convert 2.tif 2.png
convert 2.png label1.gif -gravity northwest -geometry +3+3 ^
-define compose:args=80,100 -compose dissolve -composite 2_label1.tif
I will report this on the bugs forum and see what they say.
mr_hunter
Posts: 16
Joined: 2015-12-09T08:45:47-07:00
Authentication code: 1151

Re: Stamping Image Ontop Of Other Images

Post by mr_hunter »

Thank you for fixing my issue and also logging the bug.

I'll try changing this post to solved - not used this forum before.

THanks again!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: SOLVED - Stamping Image Ontop Of Other Images

Post by fmw42 »

Not a bug. Just need to use -depth and -compress. See viewtopic.php?f=3&t=28820&p=128243#p128241
mr_hunter
Posts: 16
Joined: 2015-12-09T08:45:47-07:00
Authentication code: 1151

Re: SOLVED - Stamping Image Ontop Of Other Images

Post by mr_hunter »

Hi there - sorry I'm pretty new to this and also for completeness for other people who have this issue. What would you recommend I change the code to to negate the need of converting to png first?
As I also need convert PDF's which are a hassle to convert to png and combine again?

THanks,

Neill
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: SOLVED - Stamping Image Ontop Of Other Images

Post by fmw42 »

The command was listed in the link above and here at

viewtopic.php?f=3&t=28820&p=128243#p128241
Post Reply