Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th October 2013, 17:51   #1  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Spot The Difference (STD 1.3) *Updated* 04/11/13



About app
Compare the source image with compressed image and find the differences.

Please leave feedbacks and suggestions.

Installation guide (Windows Only):
No installation, the app is portable, smaller than 400kb, just download & run.

Download:
STD v1.3 (04/11/13)
STD v1.2 (29/10/13)
STD v1.1 (20/10/13)
STD v1.0 (19/10/13)

Source
STD v1.3

Code:
Changelog v1.3
-A lot of design changes
-Color comparison is 20x times faster than previous version
-Added drag and drop feature
-Added copy from clipboard feature (have strange bug will try to fix it in next versions)
-Added option to find color difference based on human perception (CIE76 algorithm - its 5x times slower than machine perception comparison)
-Changed algorithm of finding color difference based on machine perception (faster and more accurate)

Changelog v1.2
- A lot of design changes
- Added progress bar

Changelog v1.1
- Added error handler. (No more crashes only warning messages)
- Added default value for distance color percentage. (Default Value = 2)
- Added supported image file formats.

Last edited by Xoemab; 7th November 2013 at 04:09. Reason: Update
Xoemab is offline   Reply With Quote
Old 19th October 2013, 21:33   #2  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Sorry, but you are reinventing ImageMagick's compare.
Your name for it is "catchier" though...
raffriff42 is offline   Reply With Quote
Old 19th October 2013, 22:44   #3  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
I didn't know about ImageMAgick's, the idea came to me that time and after a quick google search I didn't find anything so I wrote it.. Still my app is 340kb and I have gui.. More to come who know maybe it will become better
Xoemab is offline   Reply With Quote
Old 19th October 2013, 23:24   #4  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 940
Quote:
Originally Posted by Xoemab View Post
the app is just 336kb
Quote:
Originally Posted by Xoemab View Post
my app is 340kb
o_O That's a huge discrepancy!

Quote:
Originally Posted by raffriff42 View Post
Sorry, but you are reinventing ImageMagick's compare.
Your name for it is "catchier" though...
Interesting. I keep seeing ImageMagick on this forum and other places but have not gotten around to seeing it's full potential. There seems to be quite a bit fun to be had with IM.

+1 for a GUI. Waiting for approval to give this a looksy.

Maybe after having my fun with this, I'll give ImageMagick a deeper look.
I like finding small programs like this. Simplistic and thought-provocative (as in I'm going to really expand my knowledge to similar projects; ie, IM).

EDIT1: Perhaps use a file host like MediaFire to share your app? Would save time from pending attachment approvals.
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)

Last edited by Sparktank; 19th October 2013 at 23:28. Reason: EDIT1; EDIT2 "quite a fun" -> "quite a BIT of fun"
Sparktank is offline   Reply With Quote
Old 20th October 2013, 00:17   #5  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Now its approved.. tomorrow I will upload the updated version where I will add error handling, now there are many ways to make the program crash so if you testing it now and the program crashing just close and open it again... As I said I made it in hurry just wanted to see if anyone was interested
Xoemab is offline   Reply With Quote
Old 20th October 2013, 00:40   #6  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Xoemab View Post
now there are many ways to make the program crash
Actually, I didn't manage to find a way to make it not crash...
Groucho2004 is offline   Reply With Quote
Old 20th October 2013, 01:13   #7  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Quote:
Originally Posted by Groucho2004 View Post
Actually, I didn't manage to find a way to make it not crash...
First you should load 2 images (in my example I used 2 .png files, not tested other formats), second you should write distance color percentage range from 0 to 100, third press compare and it give you the output.

Note: The two images should have same resolution

Edit: If you still getting crash wait until tomorrow's update

Last edited by Xoemab; 20th October 2013 at 01:17.
Xoemab is offline   Reply With Quote
Old 20th October 2013, 13:45   #8  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
I just uploaded the updated version STD v1.1
Xoemab is offline   Reply With Quote
Old 29th October 2013, 02:41   #9  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Uploaded STD v1.2.. the main differences is in the design (as you can see from video demonstration).
Xoemab is offline   Reply With Quote
Old 29th October 2013, 14:07   #10  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
I hope you'll take this as the constructive criticism it's meant to be, but STD seems incredibly slow for what it does (which is useful, don't get me wrong). What's it written in?

Have you considered implementing pasting images from the clipboard instead of opening files?

David
wonkey_monkey is offline   Reply With Quote
Old 29th October 2013, 16:36   #11  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Quote:
Originally Posted by davidhorman View Post
I hope you'll take this as the constructive criticism it's meant to be,
Of course, criticism is very important for everyone that want to make his app better.

Quote:
Originally Posted by davidhorman View Post
but STD seems incredibly slow for what it does (which is useful, don't get me wrong).
The speed is depends on your cpu, for my bad cpu (AMD Athlon II P340 Dual Core 2.20GHz it took 13 seconds to compare two 1920x800 images which is not too much if you consider that it makes 1,536,000 times computations that needed to the color distance. I think you though that I just compare two pixels to see if their equal but I not, I using this algorithm. If I just compare for equality it would be much faster.

It wasn't slow for me but I understand that for someone 10-20 seconds is slow so I will try to optimize somehow my code and also will add parallelism.

Quote:
Originally Posted by davidhorman View Post
What's it written in?
It's written in C#

Quote:
Originally Posted by davidhorman View Post
Have you considered implementing pasting images from the clipboard instead of opening files?
I have considered to implement drag and drop but I also liked your idea, will add for sure this two features in next version

Last edited by Xoemab; 29th October 2013 at 16:42.
Xoemab is offline   Reply With Quote
Old 29th October 2013, 23:38   #12  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
Would you consider sharing your source code (or part of it) for examination? I would expect even a "slow" CPU like yours to be able to make such a comparison, even on HD images, in fractions of a second.

One optimisation springs to mind: if you want to check whether sqrt((r2-r1)^2+(g2-g1)^2+(b2-b1)^2) is less than x, do this comparison instead:

Code:
(r2-r1)^2+(g2-g1)^2+(b2-b1)^2 < x^2
to save yourself the square root (which is probably the most expensive part of your computation).

I would also recommend weighting your colour differences per channel, too, as the human eye is more sensitive to green, then red, then blue.

David
wonkey_monkey is offline   Reply With Quote
Old 30th October 2013, 00:34   #13  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Quote:
Originally Posted by davidhorman View Post
Would you consider sharing your source code (or part of it) for examination? I would expect even a "slow" CPU like yours to be able to make such a comparison, even on HD images, in fractions of a second.

One optimisation springs to mind: if you want to check whether sqrt((r2-r1)^2+(g2-g1)^2+(b2-b1)^2) is less than x, do this comparison instead:

Code:
(r2-r1)^2+(g2-g1)^2+(b2-b1)^2 < x^2
to save yourself the square root (which is probably the most expensive part of your computation).
David you was right, it shouldn't take so much time, it was slow because I was using one built-in C# function to get pixel colour, I read that this built-in function is very slow and found alternative way, now it will need some miliseconds to find the difference even on shitty machine ... I will upload soon the updated version.

I will upload also the source code after cleaning my code a bit and adding some comments for better understanding.

Quote:
Originally Posted by davidhorman View Post
I would also recommend weighting your colour differences per channel, too, as the human eye is more sensitive to green, then red, then blue.
We don't need to take in consideration the human eye because we want to see how close is the pixel color to the source and not how close it is for human eyes.
Xoemab is offline   Reply With Quote
Old 30th October 2013, 10:15   #14  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
Quote:
Originally Posted by Xoemab View Post
We don't need to take in consideration the human eye because we want to see how close is the pixel color to the source and not how close it is for human eyes.
But ultimately all pixels are for human viewing. Encoders take this into account when they allow these differences in the first place (blue is allowed to be more different than green, very roughly speaking), so to me it would make sense to have this option.

Great that you've been able to speed it up!

David
wonkey_monkey is offline   Reply With Quote
Old 30th October 2013, 10:31   #15  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by davidhorman View Post
I would expect even a "slow" CPU like yours to be able to make such a comparison, even on HD images, in fractions of a second.
As demonstrated by the Avisynth Compare filter.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 30th October 2013, 13:27   #16  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Quote:
Originally Posted by davidhorman View Post
But ultimately all pixels are for human viewing. Encoders take this into account when they allow these differences in the first place (blue is allowed to be more different than green, very roughly speaking), so to me it would make sense to have this option.

Great that you've been able to speed it up!

David
Oh if so then I will add 2 options, the one I have and one for human eye so everyone could be happy
Xoemab is offline   Reply With Quote
Old 30th October 2013, 13:35   #17  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Quote:
Originally Posted by Gavino View Post
As demonstrated by the Avisynth Compare filter.
Do you mean that Compare filter do what STD do? If yes then the answer is no, the compare filter doesn't do what STD do and vice versa.
Xoemab is offline   Reply With Quote
Old 30th October 2013, 18:26   #18  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
If you're still open to suggestions, I had an idea that I'd find useful - using left/right arrows to switch between original, compressed, and original+red overlay. Then you could easily flip between any two of those, so you could use the red overlay to find the differences and then flip between original and compressed to compare small areas of difference.
wonkey_monkey is offline   Reply With Quote
Old 30th October 2013, 21:34   #19  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Quote:
Originally Posted by davidhorman View Post
If you're still open to suggestions, I had an idea that I'd find useful - using left/right arrows to switch between original, compressed, and original+red overlay. Then you could easily flip between any two of those, so you could use the red overlay to find the differences and then flip between original and compressed to compare small areas of difference.
Yeah its good idea, I had planned this for future version, I though instead of having two windows I will do like AviSynth, one window with tabs and you will switch between tabs like you said with arrows or mouse.

I was overwriting the compressed image with compressed+red but I think your idea is great to keep also the compressed. So in the next version there will be a lot of changes.. I think tomorrow it will be ready.
Xoemab is offline   Reply With Quote
Old 4th November 2013, 03:55   #20  |  Link
Xoemab
Registered User
 
Join Date: Oct 2011
Posts: 24
Added STD v1.3 with a lot of changes (see changelog, try the application). I also added the source code for anyone that want to help to improve the program.
Xoemab is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.