workflow: resize, watermark, caption

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?".
emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-20T15:29:19-07:00

I have a small problem with the watermark generation.

Under linux, evrything is fine, see picture here.
Under windows, the watermark has a somewhat brighter background, see picture here.

In both cases, I used the same command (linux grammar below which needs a quote before the emphasis):

Code: Select all

convert input/20090925_141905.JPG -resize 800 \( -size 800x100 -background none -font Arial -fill white -gravity center caption:Watermark -shade 240x40 \) -gravity south -compose overlay -composite -append output/20090925_141905.JPG
Any ideas?

Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: workflow: resize, watermark, caption

Post by Bonzo » 2018-02-20T15:41:12-07:00

In windows you do not need to escape the ( ) so use ( ) not \( \)

See Windows usage

emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-20T15:50:06-07:00

Yes, that's what I meant: I have posted the Linux-Grammar. Under Windows, there are no such backslashes.

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

Re: workflow: resize, watermark, caption

Post by snibgo » 2018-02-21T02:07:49-07:00

What versions of IM do you use?

For debugging, I suggest you insert "+write tmp.png" just before the close parentheses in each command. Post the results here. (Ensure we can see the png image, not a conversion to jpg.)
snibgo's IM pages: im.snibgo.com

emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-21T02:24:30-07:00

Ok, will try it, thanks!

emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-21T04:44:50-07:00

Here ist the windows result.

And this is the linux result.

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

Re: workflow: resize, watermark, caption

Post by snibgo » 2018-02-21T05:01:37-07:00

We can see the differences are in the alpha channel. The Windows version has partial transparency. In fact, alpha seems to be a copy of the gray values.
snibgo wrote:What versions of IM do you use?
snibgo's IM pages: im.snibgo.com

emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-21T08:08:30-07:00

Under Linux: 6.9.7-4
Under Windows: 7.0.7-22

These are different, even in the major version number. I'd like, however, to have this independant. Should be feasable: I consider imageMagick a professional tool which can yield consistenst results.

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

Re: workflow: resize, watermark, caption

Post by snibgo » 2018-02-21T08:55:32-07:00

So, ...

Code: Select all

convert -size 800x100 -background none -font Arial -fill white -gravity center caption:Watermark -shade 240x40 out.png 
... has a bad result in the alpha channel, on v7.0.7-22.

The same behaviour occurs on v7.0.3-6. The cure is to ensure the "-shade" applies to only the RGB channels:

Code: Select all

-channel RGB -shade 240x40 +channel
snibgo's IM pages: im.snibgo.com

emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-21T09:18:40-07:00

IT WORKS!

You're the MagickMaster !! :-)

I'll be back as soon as my tool is 'ready for rollout' !

PS: I must admit, that I only understood part of what you've done. But anyway, I've got a little more understanding than I had before. Thank you, this was great help!

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

Re: workflow: resize, watermark, caption

Post by snibgo » 2018-02-21T09:43:22-07:00

Good stuff.
emax wrote:I must admit, that I only understood part of what you've done.
I used two tricks. The first was to narrow down which part of your command caused the difference. The second was to remember that in v6 many operations apply only to RGB channels by default, but v7 generally includes the alpha channel by default. So if a command in v6 gives the correct alpha but v7 doesn't, this is likely to be the problem, and the cure is to explicitly limit the action to the RGB channels.
snibgo's IM pages: im.snibgo.com

emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-21T11:10:17-07:00

Nice explanation, hope I'll remember it.

My tool is ready. You can download it here, runs under Linux and Windows (win 7 tested). Handbook included though completely in German. But should be a big deal to understand. Start that thing and look - if you want. :-)

Greets,
Edgar

emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-24T14:23:19-07:00

I have updated the link in the previous post as there ist an improved version now. This link will stay in the future and always point to the latest version.

Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: workflow: resize, watermark, caption

Post by Bonzo » 2018-02-24T14:56:33-07:00

I have just given it a quick test with default settings - I need to translate some of the buttons.

One comment is the watermark is difficult to see on a dark/black backgrounds.

Anyway it is looking good.

emax
Posts: 21
Joined: 2018-02-19T03:23:45-07:00
Authentication code: 1152

Re: workflow: resize, watermark, caption

Post by emax » 2018-02-24T17:10:42-07:00

Thank you for the feedback!

The watermark is a thing to improve, right. Maybe I'll provide an extra setting "light/medium/strong" in the app in another update. And I am thinking about a multi-language version, but this is a diligence matter ... ;-)

Another extra could be a choice to sharpen the image optionally: none,light,medium,strong or so. Not the full blown IM capabilities since my focus is not on perfection but on easy application.

I will be back here at the latest when I need help with the watermark improvements.

Post Reply