comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » JPEG2000 compression ratios?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: JPEG2000 compression [message #43457 is a reply to message #41151] Thu, 14 April 2005 07:41 Go to previous messageGo to previous message
Emmanuel Christophe is currently offline  Emmanuel Christophe
Messages: 11
Registered: March 2004
Junior Member
Roberto Monaco a �crit :
> I have a question regarding JPEG2000:
>
> How do you control compression ratio when you save an image as JPEG2000
> using the IDL object?
>
> The following is curious: within a Photoshop plug-in I use to save JPEG2000
> images, "they" define a compression factor. If I save the same image with
> different compressions ratios (e.g. 1:1, 1:10, 1:40) I obviously get big
> differences in the resulting file sizes. But if you read these files into
> IDL objects, surprisingly all properties are exactly the same!! Same
> dimensions for the data array, same bit_depth, same number of layers, etc.
> ?? This does not make any sense to me ... I must be overlooking at something
> stupid?
>
> Thanks for any tips.
> Roberto
>
>

I got this problem before, I only manage to get lossless jpeg2000
compression directly with IDL. I went around this problem by calling one
free implementation of jpeg2000 (using spawn): jasper


;creating source j2k file from idl data (image)
im_jpeg=obj_new('IDLffJPEG2000',filenamesrc,/write)
im_jpeg->SetProperty, bit_depth=16, signed=1, reversible=1
im_jpeg->SetData, image
OBJ_DESTROY, im_jpeg

;compressing file
spawn,'jasper -f '+filenamesrc+'-F '+filenamenew+' -T jpc -O rate=0.2'
;reopening in IDL
im_jpeg2=obj_new('IDLffJPEG2000',filenamenew,/read)
imnew=intarr(ns,nl)
imnew=im_jpeg2->GetData()


Hope this help,
Emmanuel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Raster to Vector
Next Topic: Get IDLgrText size

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 02:53:19 PDT 2025

Total time taken to generate the page: 0.63900 seconds