Page 3 of 3
Re: Edit image in Flash and Using Imagemagick at backend
Posted: 2010-03-31T23:17:28-07:00
by snibgo
The following seems reasonable to me:
3x3 is for 3-channels (eg RGB or CMY) without translation
4x4 is for 4-channels (eg RGBA or CMYK or CMYA) without translation
5x5 is for 5-channels (eg CMYKA) without translation
4x3 is for 3-channels (eg RGB or CMY) with translation
5x4 is for 4-channels (eg RGBA or CMYK or CMYA) with translation
6x5 is for 5-channels (eg CMYKA) with translation
Any other matrix size is invalid, and will be rejected by ImageMagick. (But larger matrices may become available, if future versions can process images with more than 5 channels.)
(If, for reasons of backwards compatability, IM can't reject other matrix sizes, it should document the default values used for missing matrix elements.)
Re: Edit image in Flash and Using Imagemagick at backend
Posted: 2010-04-01T03:50:01-07:00
by xtonic
Fetched 6.6.1 and also do not notice result, although im running it from perl interfece, maybe its not affected by changes ?
Here example of color effect matrix:
Code: Select all
0.90 0.00 0.00 0.00 5.10
0.00 0.90 0.00 0.00 15.30
0.00 0.00 0.90 0.00 25.50
0.00 0.00 0.00 1.00 0.00
I converted it to IM 6x6 format:
Code: Select all
0.90 0.00 0.00 0.00 0.00 0.02
0.00 0.90 0.00 0.00 0.00 0.06
0.00 0.00 0.90 0.00 0.00 0.10
0.00 0.00 0.00 1.00 0.00 0.00
0.00 0.00 0.00 0.00 1.00 0.00
0.00 0.00 0.00 0.00 0.00 1.00
And results differ a lot, FLASH version produces completely grayscale image while IM makes colors just a little desaturated.
Re: Edit image in Flash and Using Imagemagick at backend
Posted: 2010-04-01T05:17:25-07:00
by magick
You may need to download 6.6.1 again since the ImageMagick beta on ftp.imagemagick.org is always 24 hours behind our development machine. See
http://www.emanueleferonato.com/2009/04 ... ter-class/. We use the example Flash matrix they suggest and get the expected results (gray cats):
- convert -debug transform cats.jpg -recolor \
" 0.50 0.50 0.50 0.00 0.00 0.00 \
0.50 0.50 0.50 0.00 0.00 0.00 \
0.50 0.50 0.50 0.00 0.00 0.00 \
0.00 0.00 0.00 1.00 0.00 0.00 \
0.00 0.00 0.00 0.00 1.00 0.00 \
0.00 0.00 0.00 0.00 0.00 1.00 " \
cats.png
Re: Edit image in Flash and Using Imagemagick at backend
Posted: 2010-04-19T02:44:07-07:00
by scriptguru
Guys, I have managed with this issue.
I have no time to explain all my investigations, but here is AS code to fix matrix for ImageMagick.
Code: Select all
for(var i=4;i<arr.length;i+=5){
arr[i-1]=arr[i]/255
arr[i]=0
}
arr[arr.length-2]=1
arr=arr.concat([0,0,0,0,1])
Before execution of this code "arr" variable should contain your matrix (array) which you use for ColorMatrixFilter.
In addition, this code normalizes biases so you can just use flash's output to use -recolor in ImageMagick.
Re: Edit image in Flash and Using Imagemagick at backend
Posted: 2010-05-04T14:32:30-07:00
by pong
Hi all!
I`ve tried everything described here above, but couldn`t get to change image brightness with -recolor command.
Hue, saturation works fine, but not brightness....

I use IM 6.6.1 (just upgraded, few hours ago)
Here is great sample of how flash colorMatrixFilter works ->
http://www.adobe.com/devnet/flash/artic ... ns_04.html
Could you please post here working -recolor matrix with brightness -50? or so....
[1,0,0,0,-50,
0,1,0,0,-50,
0,0,1,0,-50,
0,0,0,1,0]
Thanks a lot!
Re: Edit image in Flash and Using Imagemagick at backend
Posted: 2010-05-04T14:49:20-07:00
by pong
unbelievable, i got this
6x6 helps a lot!
Re: Edit image in Flash and Using Imagemagick at backend
Posted: 2010-05-05T00:48:08-07:00
by scriptguru
pong, 5x5 could do the job too:
[1,0,0,-50,0,
0,1,0,-50,0,
0,0,1,-50,0,
0,0,0,1,0,
0,0,0,0,1]
(of course you should normalize -50)