yut951121 Posted October 25, 2014 Share Posted October 25, 2014 I want to compare various image compression methods and see what's most efficient but to do that I need to measure how much information is lost during compression. Is there any way or plugin to do this? Thanks in advance for your help. Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted October 25, 2014 Share Posted October 25, 2014 Load the compressed image as new layer above the original (Layers Menu -> Import from File) and change it's blending mode to XOR (Layers Menu -> Layer Properties -> Blend Mode) If the two images are identical then you will see a black canvas. If they are not then any differences will appear as strange colors on a black background. Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
yut951121 Posted October 25, 2014 Author Share Posted October 25, 2014 (edited) Load the compressed image as new layer above the original (Layers Menu -> Import from File) and change it's blending mode to XOR (Layers Menu -> Layer Properties -> Blend Mode) If the two images are identical then you will see a black canvas. If they are not then any differences will appear as strange colors on a black background. I knew the xor trick, but is there any way to calculate a number out of it? (Like SSIM) Edited October 25, 2014 by yut951121 Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted October 25, 2014 Share Posted October 25, 2014 You could select the black (i.e. common pixels) then invert the selection to reach a count of dissimilar pixels. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
TechnoRobbo Posted October 25, 2014 Share Posted October 25, 2014 you can merge the layers use this code lab code - it will give you difference percentage 0 would be identical , 100 would be completely different Menu : Colors -> Difference #region UICode bool Amount1 = false; // [0,1] Slider 1 Description #endregion void Render(Surface dst, Surface src, Rectangle rect) { if (!Amount1) { Amount1=true; int totalcount = src.Width * src.Height * 1020; int PixelSum = 0; ColorBgra CP; for (int y = 0; y < src.Height; y++) { for (int x =0; x < src.Width; x++) { CP = src[x,y]; PixelSum += CP.A; PixelSum += CP.R; PixelSum += CP.G; PixelSum += CP.B; } } double result = (double)PixelSum / (double)totalcount; System.Windows.Forms.MessageBox.Show((100 * result).ToString()); } } Difference.zip Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
TechnoRobbo Posted October 25, 2014 Share Posted October 25, 2014 Uploaded a fix - should have multiplied by 1020 not 765 Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
yut951121 Posted October 25, 2014 Author Share Posted October 25, 2014 Thanks very much everyone who replied for your hard work! This made my life much happier... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.