IRON67 Posted October 6, 2016 Share Posted October 6, 2016 Ok, thx. Quote Link to comment Share on other sites More sharing options...
StephanB79 Posted April 23, 2017 Share Posted April 23, 2017 please include lossless compression mode and allow metadata in next release of your jp2 plugin. Thank you very much Quote Link to comment Share on other sites More sharing options...
null54 Posted April 23, 2017 Author Share Posted April 23, 2017 7 hours ago, StephanB79 said: please include lossless compression mode and allow metadata in next release of your jp2 plugin. The plugin should use lossless compression when the quality is set to 100. As for metadata the plugin will save the image resolution, but the JasPer library does not support saving any other metadata formats. Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
null54 Posted August 19, 2017 Author Share Posted August 19, 2017 Use static linking to remove the Visual C++ runtime dependency. Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
ektekmek Posted September 10, 2018 Share Posted September 10, 2018 Thanks for your plugin, actually thanks for all of them! I have used your WebP plugin for a while and just stumbled on a need to explore JPEG2000 for another project. One thing I've noticed as I have gotten acquainted with pdn-jpeg-2000, though, is that, when saving a file, the slider is labeled "Quality" but maps to JasPer's "rate" (/100). For example, Quality 50 in the plugin currently maps to rate 0.50. I don't think this mapping works very well. Here's my reasoning: with standard JPEG, a regular user may not know what quality technically means, but from experience they learn that something in the 90's usually has few artifacts, 80's can be OK, and something below 50 or 60 is likely to look bad. The JPEG 2000 rate, though, appears to literally be the target file size for the .JP2 file, expressed as a percentage of the size of the uncompressed image. Say I take a test image that is 512x512 -- that is 768KB uncompressed (512*512*3 bytes). If I save it with pdn-jpeg-2000 "Quality" 25 (== rate 0.25), I'm going to get a JP2 file that's approximately 768KB * 0.25 = 192KB. If I save it with rate 0.10, I'll get a JP2 file that is approximately 76.8KB. Just multiplying the rate by 100 gives someone "Quality" numbers that are not aligned with the intuitive notion of regular JPEG quality at all. For example, with a copy of the infamous Lena.png image I tested with, everything pdn-jpeg-2000 Quality 57-99 results in what appears to be a byte-for-byte identical .jp2 file, roughly the size of the lossless version. "Quality" 12 (rate 0.12, or about an 8:1 compression ratio) is the first value that ends up with a .JP2 file smaller than a Q95 standard .JPG. Quality 12 in standard JPEG would be a disaster, but it appears to be a somewhat conservatively-encoded JP2. This just seems to be how JPEG 2000 and JasPer in particular works; it's not content-adaptive but very focused on hitting a certain bitrate / compression ratio. I can think of two potential alternatives to the current quality<->rate mapping: Change the slider to be "Rate" and assume the user knows what they're doing if they are saving JPEG2000 files. If you go this route, it might be more useful to specify the rate in the UI as the reciprocal compression ratio (i.e., 8:1 instead of 0.125) since most of the lossy rates between 0.75 and 0.99 are rarely even different, yet 0.01 is a pretty big change for compression rates between 0.01 and 0.10. Keep the Quality slider, but use the non-linear conversion formula ImageMagick used to use when they used JasPer (they have apparently since switched to OpenJPEG and I guess it's different now.) I looked it up in their v7 source code, and it is roughly Rate = 100/(115-Quality)^2 for lossy mode, with Q100 mapped to lossless. Personally I like the ImageMagick curve; working it out in Excel, the mapping goes like: Quality 95 = 4:1 (rate 0.25), Q90 = 6.25:1 (rate 0.16), Q85 = 9:1 (rate 0.111), Q75 = 16:1 (rate 0.0625), Q65 = 25:1 (rate 0.04), Q45 = 49:1 (rate 0.0204), Q15 = 100:1 (rate 0.01). A little conservative, perhaps, but reasonably intuitive if you are used to standard JPEG quality values. Also, what is a sensible default? The current default of 0.95 seems like it's rarely what someone would want, since it's usually the same size as lossless, but with the potential for minor errors. Maybe something between 8:1 and 12:1 is more appropriate since it's closer to a standard JPEG compression ratios? Quote Link to comment Share on other sites More sharing options...
null54 Posted September 11, 2018 Author Share Posted September 11, 2018 Thanks for the detailed bug report and analysis. I will most likely be changing the plugin to use the ImageMagick formula with a default quality of 85 (compression ratio of 9:1). 22 hours ago, ektekmek said: The JPEG 2000 rate, though, appears to literally be the target file size for the .JP2 file, expressed as a percentage of the size of the uncompressed image. That is exactly what JasPer does (at least the version that is currently used by this plugin). Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
null54 Posted September 27, 2018 Author Share Posted September 27, 2018 Changed the quality slider in the save dialog to more closely match the JPEG compression ratios. Reduced memory usage when loading images. Fixed the loading of gray scale images with an alpha channel. 1 Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
Jas0n H Posted March 31 Share Posted March 31 I have a 90MB tiff file I want to save as JPEG 2000 using this plugin. But on save, it causes paint.net to crashing whilst the UI says computing filesize. Is there a known issue? Can't see anything at https://github.com/0xC0000054/pdn-jpeg-2000 thanks .. Jason Quote Link to comment Share on other sites More sharing options...
null54 Posted March 31 Author Share Posted March 31 26 minutes ago, Jas0n H said: But on save, it causes paint.net to crashing whilst the UI says computing filesize. Do you have a crashlog? Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait 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.