Ask Your Question

Writing jpeg 2000 images with 16 bit

asked 2016-04-15 13:53:50 -0600

fijoy gravatar image

updated 2017-08-23 05:54:35 -0600

Hi all,

I know there has been a post about OpenCV's issue with writing jp2 images with 16 bit depth, but I'm posting this here in case there has been a workaround since the last post. All I did was to read a 16-bit png image and write it back in jp2 format. Here's the code:

Mat readMat = imread("pnggrad16rgb.png", IMREAD_UNCHANGED);
imwrite(string("pnggrad16rgb.jp2"), readMat);

The image pnggrad16rgb.png was downloaded from here:

The resulting pnggrad16rgb.jp2 image is just a completely black image of the same size as the original image (I viewed it in Gimp 2.8).

Has there been a workaround to this issue?

Thanks, Fijoy

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2016-04-16 18:01:34 -0600

I made a Pull Request to solve the problem.

edit flag offensive delete link more

answered 2017-08-23 05:44:58 -0600

ttn gravatar image

It is fixed.


sturkmnen reported that in


edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-04-15 13:53:50 -0600

Seen: 2,746 times

Last updated: Aug 23 '17