ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 function IERGB2CMYK has a mistake ?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - Aug 24 2011 :  14:07:11  Show Profile  Reply
Hello,
a part of the function IERGB2CMYK looks so.

function IERGB2CMYK(const rgb: TRGB,: TCMYK;
var......
begin
.....
result.y:=255 - cmyk16.y shr 8;
result.k:=255 - cmyk16.k shr 8;
end
else
with rgb, result do
begin
k := imax(r, imax(g, b));
if k = 0 then
k :=1;
C := r * 255 div k;
M := g * 255 div k;
Y := b * 255 div k;
end;
end;

Then IERGB2CMYK(0,0,0) --> CMYK(0,0,0,1)
that is certain wrong i think.
I believe better, this function is, can maybe your that alters.

function IERGB2CMYK(const rgb: TRGB,: TCMYK;
var..........
begin
..................
result.y:=255 - cmyk16.y shr 8;
result.k:=255 - cmyk16.k shr 8;
end
else
with rgb, result do,
begin
k := imax(r, imax(g, b));
if k = 0 then
begin
C:=255;
M:=255;
Y:=255;
end
else
begin
C := r * 255 div k;
M := g * 255 div k;
Y := b * 255 div k;
end;
end;
end;

many greetings
Klaus


Klaus

fab

1310 Posts

Posted - Aug 26 2011 :  02:11:14  Show Profile  Reply
Hello,
you're right and it will be fixed in next minor release.

Anyway I suggest to leave iegUseCMYKProfile=true, to have more accurate conversion.

Many thanks for your fix!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: