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
 Layer Operation Luminanz
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - Jul 20 2012 :  03:24:17  Show Profile  Reply
Hello,
I would like to copy a part of a picture over another area.
In the example, I have copied the stones left into the layer.
The color of the background should be adopted.
With the operation of Luminanz, this perfectly goes with Photoshop.
Unfortunately, wrong color-hems originate with Imageen sees picture.
Don't the functions HSL2RGB and RGB2HSL possibly work correctly?

Example:
with Photoshop ->

66.48 KB
with Imageen ->

72.08 KB
Original:

76.38 KB

Klaus
www.klausdoege.de

fab

1310 Posts

Posted - Jul 20 2012 :  13:45:26  Show Profile  Reply
Hello,
actually there is a bug in hyieutils.pas (IEBlend procedure). Following code:
ielLuminosity:
      begin
        RGB2HSL(src, Ha, Sa, La);
        RGB2HSL(dst, Hb, Sb, Lb);
        HSL2RGB(dst, Ha, Sb, La);
      end;

Should be replaced with:
ielLuminosity:
      begin
        RGB2HSL(src, Ha, Sa, La);
        RGB2HSL(dst, Hb, Sb, Lb);
        HSL2RGB(dst, Hb, Sb, La);
      end;


Anyway my results are not yet satisfactory, maybe a new way is necessary.
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Jul 22 2012 :  05:38:10  Show Profile  Reply
Hello,
thank you for the fast correction, it now better.
Only, it is unfortunately not yet quite correct.
Some color-pixels are still represented incorrectly.
Dark areas tend too red, lightens too blue.


73.52 KB

Klaus
www.klausdoege.de
Go to Top of Page

fab

1310 Posts

Posted - Jul 24 2012 :  03:59:02  Show Profile  Reply
Many thanks for your tests. It seems that using RGB->YCbCr conversion gives better results. Please try:
ielLuminosity:
      begin
        IERGB2YCbCr(src, Y_1, Cb_1, Cr_1);
        IERGB2YCbCr(dst, Y_2, Cb_2, Cr_2);
        IEYCbCr2RGB(dst, Y_1, Cb_2, Cr_2);
      end;

Of course you have to add following new variables on top:

var
  Y_1, Cb_1, Cr_1: integer;
  Y_2, Cb_2, Cr_2: integer;


In case this is ok, then it will be added as ielLuminosity2.

Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Jul 25 2012 :  14:21:40  Show Profile  Reply
Hello Fabrizio,
Congratulation, it is perfectly like in Photoshop sees example.


89.65 KB

Klaus
www.klausdoege.de
Go to Top of Page

fab

1310 Posts

Posted - Jul 26 2012 :  10:22:07  Show Profile  Reply
Many thanks for your tests!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: