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.)
Edit image in Flash and Using Imagemagick at backend
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Edit image in Flash and Using Imagemagick at backend
snibgo's IM pages: im.snibgo.com
Re: Edit image in Flash and Using Imagemagick at backend
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:
I converted it to IM 6x6 format:
And results differ a lot, FLASH version produces completely grayscale image while IM makes colors just a little desaturated.
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
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
Re: Edit image in Flash and Using Imagemagick at backend
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
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.
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.
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])
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
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!
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
unbelievable, i got this
6x6 helps a lot!
6x6 helps a lot!
Re: Edit image in Flash and Using Imagemagick at backend
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)
[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)