ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 JP2 compression issues

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
richardc Posted - Nov 26 2020 : 10:27:11
Hello,

We are attempting to use compression for jpeg 2000, we are predominately interested in 16 bit grayscale images, which JP2 supports.

Lossless seems to work fine, but setting the quality or rate seems to have poor results. I am taking a sample image (16bit grayscale tiff), converting it to JP2, then converting it back to a 16 bit tiff.

If I compare the original image, with the uncompressed version (by subtracting one from the other) then there is a noticeable grid pattern.

If I do the same with ImageMagick then the results are as expected, a very similar image with noise.

In this case I am using 95 quality, but 0.95 rate produces the same results unsurprisingly. 95 quality in ImageMagick produces a file of a different size interestingly, but adjusting the quality to roughly match the size just produces different levels of noise.

The code is very simple:

ImageEnView1.LegacyBitmap := False;
ImageEnView1.IO.NativePixelFormat := True;
ImageEnview1.IO.LoadFromFile('F:\HWSandstone\0000.TIF');

ImageEnView1.IO.Params.J2000_ColorSpace := TIOJ2000ColorSpace.ioJ2000_GRAYLEV;
ImageEnView1.IO.Params.J2000_Quality := 95;
ImageEnView1.IO.SaveToFileJP2('F:\HWSandstone\0000-100.jp2');

I am using ImageMagick to convert back to tiff, and compare although I have also tried ImageEn and it produces identical results.

This is the expected comparison:



This is the result from ImageEn:



This is with v9.2.6, although I recently upgraded from 8.7 to see if the problem had been fixed.

Thanks!
4   L A T E S T    R E P L I E S    (Newest First)
richardc Posted - Dec 02 2020 : 04:29:59
Thank you Nigel, I've sent it to you via email.

Richard
xequte Posted - Dec 01 2020 : 20:15:12
Hi Richard

I cannot reproduce that. Can you forward the source TIFF.

I think it is best to use J2000_Rate rather than J2000_Quality. At any rate, ensure you reset the other to 1.0/100.

Nigel
Xequte Software
www.imageen.com
richardc Posted - Nov 30 2020 : 06:14:54
Thanks for the reply Nigel.

I assumed DLL because I made sure the DLL was in the same directory.

I wasn't aware of the setting, but I just changed:

IEGlobalSettings().JPEG2000Engine := ieenDLL;

Also printed out a debug message, and confirmed it was using the DLL.

The behaviour is the same, it is a 64bit app.

Thanks,

Richard
xequte Posted - Nov 27 2020 : 13:31:26
Hi

Are you using ielib or native loading?

https://www.imageen.com/help/TIEImageEnGlobalSettings.JPEG2000Engine.html

Nigel
Xequte Software
www.imageen.com