convert command change in behaviour between versions

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
furicle
Posts: 3
Joined: 2015-11-10T07:20:41-07:00
Authentication code: 1151

convert command change in behaviour between versions

Post by furicle »

Hi All

I have been using this line in a small bash script to make a thumbnail of the first page of a pdf file with a drop shadow on the whole thumbnail

Code: Select all

convert "$FILE[0]" -thumbnail 200x258 -bordercolor white -border 6 \( +clone -background black -shadow 80x3+2+2 \) +swap -background white -layers merge +repage "$FILE.gif" ;
After upgrading my OSX from 10.6 to 10.11 and reinstalling ImageMagick thru ports the output seems to have changed.
I don't know what version I was running previous (roughly three years old?) but now have
ImageMagick 6.9.2-4 Q16 x86_64 2015-11-09

I used to get something that looked like this, but now I get something that looks like this.

What makes it drop shadow each element rather then the entire thumbnail?
Assuming I have no control over the input pdf, how do I force the second behaviour every time?

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

Re: convert command change in behaviour between versions

Post by fmw42 »

see viewtopic.php?f=4&t=21269 regarding color and grayscale changes
furicle
Posts: 3
Joined: 2015-11-10T07:20:41-07:00
Authentication code: 1151

Re: convert command change in behaviour between versions

Post by furicle »

Thank you for your answer. Unfortunately either I don't understand it, or it's only a portion of the problem.

I adjusted the script to -colorspace RGB in and -colorspace sRGB out and I can see where the drop shadow is less dark.

But to me the big change was each 'item' and the INSIDE of the border is getting drop shadow now rather than just the whole thumbnail image getting one.

Stated another way - the only drop shadow I want is on the outside of the border. That's the way it used to work.

It seems like it's "smarter" now - it's seeing internal parts of the pdf that it didn't 'know' about before.
The other change I didn't mention was it used to only do the first page, now it tries to mush all the pages together.
I already updated the script to use $FILE[0] so it only operates on the first page.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert command change in behaviour between versions

Post by snibgo »

furicle wrote:But to me the big change was each 'item' and the INSIDE of the border is getting drop shadow now rather than just the whole thumbnail image getting one.
This is because the image is largely transparent. The opaque parts cause shadows, which appear in transparent areas.
snibgo's IM pages: im.snibgo.com
furicle
Posts: 3
Joined: 2015-11-10T07:20:41-07:00
Authentication code: 1151

Re: convert command change in behaviour between versions

Post by furicle »

Transparent PDF ? I didn't know that was possible. But you are right. Thanks!

I added -background white -flatten and it's behaving the way I expect it to now.

I wonder if it's a change in the input files (I don't control them) or the update that caused the change....

For the record, the line is now

Code: Select all

convert "$FILE[0]" -background white -flatten -thumbnail 200x258 -bordercolor white -border 6 \( +clone -background black -shadow 80x3+2+2 \) +swap -background white -layers merge +repage "$FILE.gif" ;
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert command change in behaviour between versions

Post by fmw42 »

Perhaps it is due to a change in version of your Ghostscript delegate.
Post Reply