decompression of gray scale images

17 views
Skip to first unread message

Beenish

unread,
Jun 4, 2011, 4:34:55 AM6/4/11
to OpenJPEG
Dear All,

I am trying to decompress a grayscale image (.j2k to .bmp) but instead
of creating the original image it creates a completely black image. Do
I need to pass any extra parameter? Does OpenJpeg deal with grayscale
images or colored images only? Please clear this? I shall be grateful.

szukw000

unread,
Jun 7, 2011, 4:07:36 AM6/7/11
to OpenJPEG
Are you able to send this J2K image?

winfried

Beenish

unread,
Jun 8, 2011, 2:00:26 AM6/8/11
to OpenJPEG
If by send you mean compress the original image( bmp to j2k), yes the
compression works fine, but when I try to decompress the image (j2k to
bmp), it produces a black image. All the pixel values are zero!

I am using this command to compress the image: image_to_j2k.exe -i
gray_goldhill.bmp -o temp.j2k
and the following command to decompress it: j2k_to_image.exe -i
temp.j2k -o gray_goldhill_new.bmp

Can you please tell me where is the problem and how I can solve it?

Thanks!

szuk...@arcor.de

unread,
Jun 8, 2011, 5:21:15 AM6/8/11
to open...@googlegroups.com
On 08.06.2011, 08:00, Beenish wrote:

> If by send you mean compress the original image( bmp to j2k)

No, I mean: could you send the orignal image 'gray_goldhill.bmp' ?

winfried

Beenish

unread,
Jun 9, 2011, 2:38:06 AM6/9/11
to OpenJPEG
I am sending you a link from where I got this image:

http://www.eecs.qmul.ac.uk/~phao/CIP/Images/Goldhill.bmp

Mathieu Malaterre

unread,
Jun 9, 2011, 2:45:15 AM6/9/11
to open...@googlegroups.com
On Thu, Jun 9, 2011 at 8:38 AM, Beenish <beenish...@gmail.com> wrote:
> I am sending you a link from where I got this image:
>
> http://www.eecs.qmul.ac.uk/~phao/CIP/Images/Goldhill.bmp

I can reproduce it here on linux. this bmp file is not supported by
image_to_j2k. Simply converting the bmp to tiff (imagemagick convert)
did the trick.

I would open a bug in the database for this.

--
Mathieu

szuk...@arcor.de

unread,
Jun 10, 2011, 1:04:30 AM6/10/11
to open...@googlegroups.com
Here is a first patch using OpenJPEG-1.4.0-revision-787.

bmptoimage() needs a re-coding. It takes for granted
a header size of 40.

winfried

OpenJPEG-1.4.0-revision-787-1-bmp.dif
Reply all
Reply to author
Forward
0 new messages