Solved

JPGE Images

Posted on 2004-04-19
6
203 Views
Last Modified: 2010-04-05
Hi Experts,

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

k4hvd
0
Comment
Question by:k4hvd77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10860931

   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
 
LVL 4

Expert Comment

by:mbprogrammer
ID: 10862330
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
 
LVL 4

Author Comment

by:k4hvd77
ID: 10862419
mbprogrammer,
I need a fast method! Could you post some codes how to do theat?


k4hvd77
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Accepted Solution

by:
mbprogrammer earned 250 total points
ID: 10863125
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
 
LVL 4

Expert Comment

by:mbprogrammer
ID: 10863245
have a look at here is good : http://www.catenary.com/howto/comparator.html
0
 
LVL 4

Author Comment

by:k4hvd77
ID: 10869808
thank you mbprogrammer ;)


k4hvd77
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question