Montage: Frame is missing pixels when using labels

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
xberg
Posts: 13
Joined: 2017-11-23T03:02:10-07:00
Authentication code: 1152

Montage: Frame is missing pixels when using labels

Post by xberg »

Hi,

Please look at this image from the imagemagick codex when doing a montage with both -frame and -label
http://prntscr.com/he5lz8
Taken from here:
http://www.imagemagick.org/Usage/montage/

The frame is missing pixels in the bottom left area: the label is overlapping the frame and removing these pixels. It's not so bad when as in the example above I use a grey label background, but if I use a white label background it looks horrible.

So my question:
How can I do a montage with both a -frame and -label and still have a full frame around both my photo and image and not one with missing pixels?

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

Re: Montage: Frame is missing pixels when using labels

Post by fmw42 »

I do not understand. I do not see any missing pixels. Can you explain further what and where they are missing and how I should examine to see that issue. The left edge of the each image has a frame that is lighter on the left side and darker on the right side. That is correct behavior.

Please always provide your ImageMagick version and platform when asking questions. Also provide your code and your input and output images, so we can see what you are actually getting.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Montage: Frame is missing pixels when using labels

Post by Bonzo »

It's not so bad when as in the example above I use a grey label background, but if I use a white label background it looks horrible.
In that case why not add an image with white we can see?

I agree with fmw42 as it looks Ok to me as well
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Montage: Frame is missing pixels when using labels

Post by fmw42 »

All these examples work as expected.

Code: Select all

montage -label Balloon   balloon.gif  \
-label Medical   medical.gif  \
\( present.gif  -set label Present  \) \
\( shading.gif  -set label Shading  \) \
-tile x1  -frame 5  -geometry '60x60+2+2>' \
-title 'My Images'  titled1.jpg
Image

Code: Select all

montage -label Balloon   balloon.gif  \
-label Medical   medical.gif  \
\( present.gif  -set label Present  \) \
\( shading.gif  -set label Shading  \) \
-tile x1  -frame 5  -geometry '60x60+2+2>' \
-title 'My Images'  -background white   titled2.jpg
Image

Code: Select all

montage -label Balloon   balloon.gif  \
-label Medical   medical.gif  \
\( present.gif  -set label Present  \) \
\( shading.gif  -set label Shading  \) \
-tile x1  -frame 5  -geometry '60x60+2+2>' \
-title 'My Images'  -bordercolor white   titled3.jpg
Image

Code: Select all

montage -label Balloon   balloon.gif  \
-label Medical   medical.gif  \
\( present.gif  -set label Present  \) \
\( shading.gif  -set label Shading  \) \
-tile x1  -frame 5  -geometry '60x60+2+2>' \
-title 'My Images'  -mattecolor skyblue   titled4.jpg
Image

Code: Select all

montage -label Balloon   balloon.gif  \
-label Medical   medical.gif  \
\( present.gif  -set label Present  \) \
\( shading.gif  -set label Shading  \) \
-tile x1  -frame 5  -geometry '60x60+2+2>' \
-title 'My Images'  -mattecolor white   titled5.jpg
Image

What you are seeing is the way framing works. It tries to lighten the color on the left and darken it on the right. Since the color is white, you cannot make it lighter. It works fine to lighten as in titled4.jpg with skyblue color, but cannot lighten anymore in titled5.jpg with white.
xberg
Posts: 13
Joined: 2017-11-23T03:02:10-07:00
Authentication code: 1152

Re: Montage: Frame is missing pixels when using labels

Post by xberg »

Here is an example of what I mean
http://prntscr.com/hql0yo
On the left it is not good. I am expecting the frame to go all around the image, not leave a few pixels on the lower left side.

On the right it's good: this is what I expect everywhere.

Generated with -frame 6 -mattecolor "#eeeeee" -bordercolor "#fdfdfd"
Using IM version 7.0.7-11 Q16 for windows
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Montage: Frame is missing pixels when using labels

Post by fmw42 »

See my examples above:

What you are seeing is the way framing works. It tries to lighten the color on the left and darken it on the right. Since the color is white, you cannot make it lighter.
Post Reply