Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

JPGE Images

Hi Experts,

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

k4hvd
0
k4hvd77
Asked:
k4hvd77
  • 3
  • 2
1 Solution
 
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
 
k4hvd77Author Commented:
mbprogrammer,
I need a fast method! Could you post some codes how to do theat?


k4hvd77
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
mbprogrammerCommented:
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
 
mbprogrammerCommented:
have a look at here is good : http://www.catenary.com/howto/comparator.html
0
 
k4hvd77Author Commented:
thank you mbprogrammer ;)


k4hvd77
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now