Hello Team,
Can any one please let me know how I am getting the two different image mode for the trim output of an image.
Like I am checking the below command on my two different servers which are having different image magick versions installed.
Server 1: Version "ImageMagick 6.7.8-9" is installed and when I am executing the below command then the output image mode in photoshop is showing "RGB" and which is correct because my input image mode is also in "RGB".
Server 2: Version "ImageMagick 6.9.4-10" is installed and when I am executing the below command then the output image mode in photoshop is showing "Grayscale" and which is I think incorrect because my input image mode is in "RGB".
COMMAND:
exec("convert iuputImg.jpg -fuzz 1% -trim +repage outputImg.jpg");
Please any one let me know what exactly I am doing wrong or what need to be added in mentioned command. Also I used the PHP "trimImage " function and same issue faced with this also.
Let me know if anyone need the input image for checking.
Thanks in advanced
Imagick trimImage function issue
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imagick trimImage function issue
Yes, we do. Otherwise we can only guess.mjamal wrote:Let me know if anyone need the input image for checking.
My guess is that the trimmed image contains no colour, all the pixels are some shade of gray. Some versions of IM will realise this, and save the image in the most efficient way.
snibgo's IM pages: im.snibgo.com
Re: Imagick trimImage function issue
Hello Snibgo,
Here is the input image which I am using for testing in both of my servers. Also yes the input image is having gray shades but in both of my servers the image mode is showing different.
INPUT IMAGE:
Here is the input image which I am using for testing in both of my servers. Also yes the input image is having gray shades but in both of my servers the image mode is showing different.
INPUT IMAGE:
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imagick trimImage function issue
So my guess was correct, and IM saves the image in the most space-saving mode. "-type truecolor" will force RGB mode, ie the output will contain colour channels.
snibgo's IM pages: im.snibgo.com
Re: Imagick trimImage function issue
@ Snibgo, Yes from "-type truecolor", I am now able to get the image mode in RGB. Thank you.