Page 1 of 1
B/W Images Lighten on Annotation
Posted: 2016-07-03T12:50:52-07:00
by indjeto
I saw that on B/W images while trying to annotate them, the whole image becomes lighter than the source image.
For full color images it is ok.
I saw the same affect happens also when trying to composite one small image over the b/w source.
I was using php lib, but also tried with this command:
Code: Select all
convert in2.jpg -background Orange label:'Faerie Dragon' +swap -gravity Center -append out2.jpg
The same effect.
Unfortunately I don't see a way to attach files here
I'm using up to date Ubuntu 14.04.4 LTS with imagick from package.
Version: ImageMagick 6.7.7-10 2016-06-01 Q16
Re: B/W Images Lighten on Annotation
Posted: 2016-07-03T13:59:53-07:00
by snibgo
IM v6.7.7 was confused about grayscale images. I suggest you upgrade to a recent version.
Re: B/W Images Lighten on Annotation
Posted: 2016-07-03T14:00:28-07:00
by fmw42
IM 6.7.7.10 had linear grayscale images and swapped RGB and sRGB. That causes the darkening. See
viewtopic.php?f=4&t=21269. You would be best off upgrading to a current version of Imagemagick. If you cannot do that, then try
Code: Select all
convert in2.jpg -set colorspace RGB -background Orange label:'Faerie Dragon' +swap -gravity Center -append out2.jpg
But why do you have -background orange. Seems as though you are creating a color image for the label and appending to in2.jpg, which I presume is grayscale. So lets separate the issues. What is getting darkened?
Can you post your input in2.jpg and out2.jpg to some place such as dropbox.com, so we can see what is going on and test with your command.
Re: B/W Images Lighten on Annotation
Posted: 2016-07-05T03:19:49-07:00
by indjeto
Thanks all for the replies.
I attached the files here:
http://ge.tt/2kvlr8c2
fmw42, the original image got lightened. I tried changing Orange with White, but the same effect.
I tried this command and it worked fine:
Code: Select all
convert in2.jpg -background Orange label:'Faerie Dragon' +swap -gravity Center -append -colorspace RGB out2.jpg
I'm don't understand very much the details but if I always use this param for all site images, it may broke the non b/w ones?
I'm curious and if this is fixed in the new version and which one will you recommend.
As a last resort I will try to build it from source as I'm having the last ubuntu package.
Re: B/W Images Lighten on Annotation
Posted: 2016-07-05T09:30:38-07:00
by fmw42
On my current IM 6.9.5.0 Q16 Mac OSX, this works fine.
Code: Select all
convert in2.jpg -background Orange label:'Faerie Dragon' +swap -gravity Center -append out.jpg
On IM 6.7.7.10 Q16 Mac OSX, the above produces a lighter image.
But the following works fine for me on 6.7.7.10 without lightening the image. Note where I put the -set colorspace RGB. You put -colorspace RGB at the end, which is not what I wrote before.
Code: Select all
convert in2.jpg -set colorspace RGB -background Orange label:'Faerie Dragon' +swap -gravity Center -append out.jpg
IM 6.7.7.10 is over 170 versions old. I would recommend that you upgrade to the current IM.
EDIT: In further review of the results, my 6.7.7.10 system did not work to put in the label, so I cannot say if it properly works. It is just too old a release for my current delegates. But try my exact command above and let us know if that works.
Re: B/W Images Lighten on Annotation
Posted: 2016-07-06T08:05:04-07:00
by indjeto
fmw42,
Code: Select all
convert in2.jpg -set colorspace RGB -background Orange label:'Faerie Dragon' +swap -gravity Center -append out.jpg
did not work.
It works only when you put it at the end.
I found and some other issues with my version, trying to auto orient images, so it seems installing a new version will be a better option.
At Image magick's site the last version is 7. What will you recommend 7 or 6.9?
Re: B/W Images Lighten on Annotation
Posted: 2016-07-06T09:18:03-07:00
by fmw42
You can use either, but with v7 you need to use magick in place of convert. See
http://imagemagick.org/script/porting.php#cli.
Re: B/W Images Lighten on Annotation
Posted: 2016-07-08T08:19:52-07:00
by indjeto
I'm using it from php.
I updated to ImageMagick-7.0.2-2.
It works as expected.