GetPixels() or Get(Pixel[x,y])
Posted: 2018-11-06T18:23:19-07:00
Hello
gives, for example, such lines, with a png picture, having an alpha channel (RGBA) :
541 4 64764,65535,65535,65278 64764 65535 65535 257 61
RGB values are the same. Ok. Check!
A is not the same. (A from RGBA). Ko. Don't give me 5
Hexadecimal values going by couple:
0101 <-> FDFD
0202 <-> FEFE
0303 <-> FCFC
0000 <-> FFFF
Does anyone know what is going wrong ?
Why GetPixels() and Get(Pixel[]) give different values ?
What is the relation between those 2 values of opacity ?
Thank you for your attention.
Code: Select all
my @cp=$image->GetPixels(x=>$x,y=>$y, height=>1, width=>1);
print "$x $y ".$image->Get("pixel[$x,$y]")." $cp[0] $cp[1] $cp[2] $cp[3] $res\n";
Code: Select all
923 0 45232,45746,44461,64764 45232 45746 44461 771 39
109 1 0,514,514,257 0 514 514 65278 42
218 2 257,514,257,771 257 514 257 64764 100
(...)
478 9 65021,65278,65021,65535 65021 65278 65021 0 100
692 10 65021,65278,65535,65021 65021 65278 65535 514 110
RGB values are the same. Ok. Check!
A is not the same. (A from RGBA). Ko. Don't give me 5
Hexadecimal values going by couple:
0101 <-> FDFD
0202 <-> FEFE
0303 <-> FCFC
0000 <-> FFFF
Does anyone know what is going wrong ?
Why GetPixels() and Get(Pixel[]) give different values ?
What is the relation between those 2 values of opacity ?
Thank you for your attention.