Issue of montage command

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Mitunobu Watanabe
Posts: 12
Joined: 2015-06-25T21:30:44-07:00
Authentication code: 6789

Issue of montage command

Post by Mitunobu Watanabe »

There is that the image was converted in the montage command is not correct.
Montage command does not return an error.
I asked previously: viewtopic.php?f=3&t=27918
However, it has occurred in the latest version.
It will describe my execution environment.

OS: CentOS Linux release 7.1.1503 (Core)
IM: ImageMagick 6.9.2-0 Q16 x86_64 2015-08-26
libjpeg-turbo: 1.2.90-5.el7

(Execute command)
montage -define jpeg:size:512.0x512.0 -background 'RGB(231, 227, 222)' -geometry 256x256 -tile 2x2 a.jpg b.jpg c.jpg d.jpg -quality 100 abcd.jpg

(Use image 1)
a.jpg : https://drive.google.com/open?id=0B8lpq ... ThiVl9iMGM
b.jpg : https://drive.google.com/open?id=0B8lpq ... HhhMk5jdUk
c.jpg : https://drive.google.com/open?id=0B8lpq ... 05aY2x1MTg
d.jpg : https://drive.google.com/open?id=0B8lpq ... mkyeVV1aFE
abcd.jpg: https://drive.google.com/open?id=0B8lpq ... GVUSEhfNWM

(Use image 2)
a.jpg : https://drive.google.com/open?id=0B8lpq ... mVzeXF2RGM
b.jpg : https://drive.google.com/open?id=0B8lpq ... EN3aGdXMHM
c.jpg : https://drive.google.com/open?id=0B8lpq ... 0tuOC1XRW8
d.jpg : https://drive.google.com/open?id=0B8lpq ... 0N3amFsRTg
abcd.jpg: https://drive.google.com/open?id=0B8lpq ... 2s0ampodWM

(Use image 3)
a.jpg : https://drive.google.com/open?id=0B8lpq ... ndQbHUtRDg
b.jpg : https://drive.google.com/open?id=0B8lpq ... 2hDN3Q0WU0
c.jpg : https://drive.google.com/open?id=0B8lpq ... i1iWWNWTGs
d.jpg : https://drive.google.com/open?id=0B8lpq ... TdHejRrVEk
abcd.jpg: https://drive.google.com/open?id=0B8lpq ... Wx6dldGa0U

(Use image 4)
a.jpg : https://drive.google.com/open?id=0B8lpq ... WRuYkJ2ZTg
b.jpg : https://drive.google.com/open?id=0B8lpq ... jIzakRRV1k
c.jpg : https://drive.google.com/open?id=0B8lpq ... WpHM0hULWM
d.jpg : https://drive.google.com/open?id=0B8lpq ... i1yTWpmdzA
abcd.jpg: https://drive.google.com/open?id=0B8lpq ... kZoQ2JQN28

Note: Previous error images is converted successfully in the latest version.
Note: Current error images is converted successfully in the old version.
246246
Posts: 190
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: Issue of montage command

Post by 246246 »

I see no problem on your all 4 image sets when converting with ImageMagick 6.9.2-0 Q16 x86_64 on MacOS (installed from MacPort.) I guess your jpeg-turbo may the cause of problem. In my environment, official jpeg is also installed from MacPort and its version is 9a.
Mitunobu Watanabe
Posts: 12
Joined: 2015-06-25T21:30:44-07:00
Authentication code: 6789

Re: Issue of montage command

Post by Mitunobu Watanabe »

Thank you for answering.
I also libjpeg-turbo was I think the cause.
However, that the results vary from IM version it was worrisome.
I for the case which has been performed a reduction in front of the montage, gave an additional test.

mogrify -geometry 256x256+0+0 -quality 100 *.jpg
montage -define jpeg:size:512.0x512.0 -background 'RGB(231, 227, 222)' -geometry 256x256+0+0 -tile 2x2 a.jpg b.jpg c.jpg d.jpg -quality 100 abcd.jpg

The result was a success.
Problem that I have had, resolved in this way.
However, if no wrong use of my montage command, I think that it is good if accustomed to be able to run in one command.
Mitunobu Watanabe
Posts: 12
Joined: 2015-06-25T21:30:44-07:00
Authentication code: 6789

Re: Issue of montage command

Post by Mitunobu Watanabe »

How to run the mogrify before montage, was not perfect.
I try the version up of libjpeg-turbo.
However, please tell me if there is a idea to other causes.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue of montage command

Post by fmw42 »

If you are using mogrify to resize the images, then try

Code: Select all

mogrify -resize 256x256 -quality 100 *.jpg
montage -define jpeg:size:2560x256 -background 'RGB(231, 227, 222)' -geometry +0+0 -tile 2x2 a.jpg b.jpg c.jpg d.jpg -quality 100 abcd.jpg
-geometry is not a good way to resize images.

If the images are already at 256x256, why is your jpeg hit 512x512. Also decimals are not needed and will be truncated.
Mitunobu Watanabe
Posts: 12
Joined: 2015-06-25T21:30:44-07:00
Authentication code: 6789

Re: Issue of montage command

Post by Mitunobu Watanabe »

Thank you for answering.
In some cases successful in presented command.
However, it was not complete when I run in the other image.

mogrify -resize 256x256 -quality 100 *.jpg
montage -define jpeg:size:512x512 -background 'RGB(231, 227, 222)' -geometry +0+0 -tile 2x2 a.jpg b.jpg c.jpg d.jpg -quality 100 abcd.jpg

Do you have a reason to "jpeg:size:2560x256"?
I was running in the "jpeg:size:512x512" of image size exactly.

Also, I did the binding of image in the convert command.

mogrify -resize 256x256 -quality 100 *.jpg
convert -define jpeg:size:256x512 -background 'RGB(231, 227, 222)' -quality 100 +append a_256.jpg b_256.jpg ab.jpg
convert -define jpeg:size:256x512 -background 'RGB(231, 227, 222)' -quality 100 +append c_256.jpg d_256.jpg cd.jpg
convert -define jpeg:size:512x512 -background 'RGB(231, 227, 222)' -quality 100 -append ab.jpg cd.jpg abcd.jpg

This is also same, there is a successfully case and the error case.

I do not have the libjpeg-turbo version up.
I will try looking for the appropriate version to environment.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue of montage command

Post by fmw42 »

Try putting -quality 100 before the input images. Also I do not know if montage allows any -define options. So try without the jpeg size hint.

It is strange that your mogrify and convert commands do not work. That might be the libjpeg issue you mention. Or perhaps it is a corrupt image.
Mitunobu Watanabe
Posts: 12
Joined: 2015-06-25T21:30:44-07:00
Authentication code: 6789

Re: Issue of montage command

Post by Mitunobu Watanabe »

I'm sorry, bad my description.
Command is not an error.
The converted image is incorrect, like topic.

I have an image other than the topic.
But, since the number of images is large, it can not be posted for all.
Even if the image of the topic is successful in the conversion, converted other image is incorrect.

Postscript:
I tried putting -quality 100 before the input images.
However, converted image is incorrect.

Also, I still can not start the version-up work of libjpeg-turbo.
I will begin work after next week.
Mitunobu Watanabe
Posts: 12
Joined: 2015-06-25T21:30:44-07:00
Authentication code: 6789

Re: Issue of montage command

Post by Mitunobu Watanabe »

Note: Current my situation

If the converted image is incorrect,
To resolve in a way that had you taught me until now.
* Also solves the "-quality 99".
However, converted other image is incorrect.

This case is error in the program does not occur.
Therefore, I can not create re-conversion program.

I'm trying to solve with libjpeg-turbo version up.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue of montage command

Post by fmw42 »

Which of your image sets in your original post are correct and which are bad with IM 6.9.2.0?

What do you get from

Code: Select all

convert -version
Mitunobu Watanabe
Posts: 12
Joined: 2015-06-25T21:30:44-07:00
Authentication code: 6789

Re: Issue of montage command

Post by Mitunobu Watanabe »

Get version:
# convert -version
Version: ImageMagick 6.9.2-0 Q16 x86_64 2015-08-26 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc jbig jng jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff webp wmf x xml zlib

This is the result of running in a other image set.
Results are different in the combination of Image and Command.
Also, If these commands are converting the image of the topic, it will be successful in the conversion.
In this way, there are successes and failures by the command.

(Use image 5)
a.jpg : https://drive.google.com/open?id=0B8lpq ... GoyM2tfeW8
b.jpg : https://drive.google.com/open?id=0B8lpq ... ndzTUlpakk
c.jpg : https://drive.google.com/open?id=0B8lpq ... HJxdHZ4Ync
d.jpg : https://drive.google.com/open?id=0B8lpq ... UI5WmVSWDQ

(Use image 6)
a.jpg : https://drive.google.com/open?id=0B8lpq ... WhtTXJ3MkE
b.jpg : https://drive.google.com/open?id=0B8lpq ... DlLYU9yY1E
c.jpg : https://drive.google.com/open?id=0B8lpq ... 3Jvb01jYk0
d.jpg : https://drive.google.com/open?id=0B8lpq ... Eg4cERUU2s

(Execute command 1)
mogrify -resize 256x256 -quality 100 *.jpg
montage -define jpeg:size:512x512 -background 'RGB(231, 227, 222)' -geometry +0+0 -quality 100 -tile 2x2 a.jpg b.jpg c.jpg d.jpg abcd.jpg
* (Use image 5 result)
** abcd.jpg : https://drive.google.com/open?id=0B8lpq ... kRxc0FrQUU
* (Use image 6 result)
** abcd.jpg : https://drive.google.com/open?id=0B8lpq ... jY4OWI0X1U

(Execute command 2)
mogrify -resize 256x256 -quality 100 *.jpg
convert -define jpeg:size:256x512 -background 'RGB(231, 227, 222)' -quality 100 +append a.jpg b.jpg ab.jpg
convert -define jpeg:size:256x512 -background 'RGB(231, 227, 222)' -quality 100 +append c.jpg d.jpg cd.jpg
convert -define jpeg:size:512x512 -background 'RGB(231, 227, 222)' -quality 100 -append ab.jpg cd.jpg abcd.jpg
* (Use image 5 result)
** ab.jpg : https://drive.google.com/open?id=0B8lpq ... lVHbHlGbEE
** cd.jpg : https://drive.google.com/open?id=0B8lpq ... GltMTN2bGs
** abcd.jpg : https://drive.google.com/open?id=0B8lpq ... XRiVXFOeG8
* (Use image 6 result)
** ab.jpg : https://drive.google.com/open?id=0B8lpq ... DVMSFRHbXM
** cd.jpg : https://drive.google.com/open?id=0B8lpq ... WdoVktkSkU
** abcd.jpg : https://drive.google.com/open?id=0B8lpq ... HJKVWRaSUU

Postscript:
libjpeg-turbo version up have difficulties.
Struggled the installation method to CentOS 7 for libjpeg-turbo 1.4.2.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue of montage command

Post by fmw42 »

Sorry I know nothing about libjpeg-turbo. Have you tried with the normal libjpeg?
Mitunobu Watanabe
Posts: 12
Joined: 2015-06-25T21:30:44-07:00
Authentication code: 6789

Re: Issue of montage command

Post by Mitunobu Watanabe »

No, I don't know how to build libjpeg-devel, it was abandoned.

Also, I decided to use the libjpeg-turbo1.2.90-5.el7.
In consideration of the stability.

The original image was a TIFF.
That was converted to jpeg was a problem.
The description was a shortage, I'm sorry.

My issue is resolved as following.
1. To convert the original image to a bitmap.
2. Combine the bitmap at the montage command.
3. To convert the bitmap to jpeg.

Thank you for your long-term support.
Post Reply