Invert Image Processing and Source Code In Delphi

Hi Friend. Do You need Source Code of Image Processing..? But I’m only have in Delphi Programming. It is easy to Follow and Understand.

Invert Image is one of image processing to invert the color. The easy way to understand is Change Black Color to White and White to Black, but there are variation if the Red, Green and Blue value have variation.

Invert Image Basically obtain from decrease Value of 255 to Red Pixel Value, 255 to Green Pixel Value and 255 to B Pixel Value.



Below is Source Code for Invert Image Processing in Delphi.


procedure TForm1.ToolButtonInvertClick(Sender: TObject);
var i,j :byte;
PH:PByteArray;
R,G,B : integer;
begin
for i:=0 to FormHasil.ImgHasil.Height-1 do
begin
PH:=FormHasil.ImgHasil.Picture.Bitmap.ScanLine[i];
for j:=0 to FormHasil.ImgHasil.Width-1 do
begin
R:=255-PH[3*j];
G:=255-PH[3*j+1];
B:=255-PH[3*j+2];

PH[3*j]:= R;
PH[3*j+1]:= G;
PH[3*j+2]:= B;
end;
end;
FormHasil.ImgHasil.Repaint;
FormHistogram.Histogram;
end;


Please Comment If I’m Wrong. Comment are widely open…!!

Komentar FB


Probably Related Article



2 comments:

Revive Energy Mints said...
May 3, 2010 at 11:56 PM

This is a nice way to spice up your pictures...I also want to try doing this on some of my pics..I bet they will also look more interesting and artistic.

Pest Control Toronto said...
August 22, 2010 at 2:42 AM

I was searching it for long time but didn't find yet. But now you have solved my problem. I am going to start my practice. Thanks for sharing such valuable info with us.

Related Posts by Categories



Widget by