JPGE Images

Hi Experts,

Could anybody tell me how to check if two Images are identically or not? (JPGE )

k4hvd
LVL 4
k4hvd77Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mbprogrammerConnect With a Mentor Commented:
this is a very simple and easy way to check the equality of two icons. you can change it for bmps.

function IconsAreEqual(const Icon1, Icon2: TIcon): Boolean;
var
  ms1: TMemoryStream;
  ms2: TMemoryStream;
begin
  Result := False;
  ms1    := TMemoryStream.Create;
  try
    Icon1.SaveToStream(ms1);
    ms2 := TMemoryStream.Create;
    try
      Icon2.SaveToStream(ms2);
      if ms1.Size = ms2.Size then
        // Compare the streams, Streams vergleichen:
        Result := CompareMem(ms1.Memory, ms2.Memory, ms1.Size)
      finally
        ms2.Free
    end
  finally
    ms1.Free
  end
end;

for better algorithms codes, you should search , I cann't help you now, I have many works to do (sorry) ;)
0
 
Ivanov_GCommented:

   uses
      jpeg;

   var
     jpg_file : TJpegImage;

   load the JPG image in this JpegImage and the convert to Bitmap using Bitmap.Assign(JPG_file) method. Now you have 2 Bitmaps which have Canvas propery and you can compare them.

    The other way is to compare the size, the headers, etc. but this don't guarantee you anything.
0
 
mbprogrammerCommented:
There are many algorithms for this purpos. it depends on your destination
(I mean your app usage) some of them compares RGB colors. it's a fast and trustable method. they compared the amount of each color not the pixeles and not the position of them. they also after getting the ture result from this test , they will test a little amount of pixels and their positions.
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
k4hvd77Author Commented:
mbprogrammer,
I need a fast method! Could you post some codes how to do theat?


k4hvd77
0
 
mbprogrammerCommented:
have a look at here is good : http://www.catenary.com/howto/comparator.html
0
 
k4hvd77Author Commented:
thank you mbprogrammer ;)


k4hvd77
0
All Courses

From novice to tech pro — start learning today.