JPEG2000 decompression
Hi all
I have been asked to handle JPEG2000 images.
Has anyone had any experience of this before and can advise me if I might have a problem trying to decompress 24 Frames a second on a reasonable machine.
Any help would be appreciated
Regards
Mark.
Thanks matfud..
I thought as much! .. Image size will be 752 * 494 just for the record
Regards
Mark.
Similar Messages
-
Is the IMAQ library going to implement the new JPEG2000 image compression technology in the future? I would think it to be a viable alternative to VisionStream for real time video dumping to hard drives.
ThanksDerick,
I would also like to see JPEG2000 implemented, since you get high quality images with high compression ratios. However, I don't expect it to work well for streaming to disk real time. Image compression takes time, so you will either lose a lot of image quality or it will be too slow to do it real time. Once the video is compressed, it will probably play back real time quite well, since decompression usually takes less time than compression.
Bruce
Bruce Ammons
Ammons Engineering -
Questions on reading in JPEG2000 Images
I am currently having an issue reading in jpeg2000 images. The issue is that I cannot find a way to extract metadata that is in the file and also extracting an area of interest in the image is painfully slow. i tried doing a ImageReader.getImageMetadata() but it doesn't return anything useful that i was looking for in the metadata portion. Below is a snippet of the a dummy code i put together. Its intention is to read a 10x10 block starting in the 0,0 location. This code is painfully slow. Am i doing something wrong? Error handling is left for now.
J2KImageReader j2kImageReader = (J2KImageReader) ImageIO
.getImageReadersByFormatName(
"jpeg2000").next();
j2kImageReader.setInput(new FileImageInputStream(new File(p_fileLocation)));
ImageReadParam imageReadParam = j2kImageReader.getDefaultReadParam();
imageReadParam.setSourceRegion(new Rectangle(0, 0, 10, 10));
IIOImage image = j2kImageReader.readAll(0, imageReadParam);Also i forgot to mentioned that the above code looks like it is scanning and reading in all the pixels and returning the ones that i specified in the ImageReadParam class
-
File access to /res folder before decompression
Hi, anyone please assist on how i would access a compressed text file in the /res folder before I can decompress it. I also need to know if its possible to create a file since the decompression algorithm creates a new decompressed file. The following code runs on a computer but I need to use it in the J2ME platform by calling it from the midlet class. Any assistance will be highly appreciated:
import java.io.*;
import java.util.*;
public class Decompress{
final static int MAX_CODES = 4096;
final static int BYTE_SIZE = 8;
final static int EXCESS = 4;
final static int ALPHA= 256;
final static int MASK = 15;
static int [] s;
static int size;
static Element [] h;
static int leftOver;
static boolean bitsLeftOver;
static BufferedInputStream in;
static BufferedOutputStream out;
private static void setFiles(String[] args) throws IOException{
String inputFile, outputFile;
if(args.length >= 1){
inputFile = args[0];
if(!inputFile.endsWith(".lzw")){
System.out.println("The filename must end with \"lzw\" extension");
System.exit(1);
in = new BufferedInputStream(new FileInputStream(inputFile));
outputFile = inputFile.substring(0, inputFile.length()-4);
out = new BufferedOutputStream(new FileOutputStream(outputFile));
else{
System.out.print("usage:java Decompress <filename>");
System.exit(1);
private static void output(int code)throws IOException{
size = -1;
while(code>=ALPHA){
s[++size]=h.suffix;
code = h.prefix;
s[++size]=code;
for(int i=size; i>=0; i--)
out.write(s);
private static int getCode() throws IOException{
int c = in.read();
if(c == -1)return -1;
int code;
if(bitsLeftOver)
code = (leftOver<<BYTE_SIZE)+c;
else{
int d = in.read();
code = (c<<EXCESS)+(d>>EXCESS);
leftOver = d&MASK;
bitsLeftOver = !bitsLeftOver;
return code;
private static void decompress() throws IOException{
int codeUsed = ALPHA;
s = new int[MAX_CODES];
h = new Element[MAX_CODES];
int pcode = getCode(), ccode;
if(pcode>=0){
s[0] = pcode;
out.write(s[0]);
size = 0;
do{
ccode = getCode();
if(ccode<0)break;
if(ccode<codeUsed){
output(ccode);
if(codeUsed<MAX_CODES)
h[codeUsed++] = new Element(pcode, s[size]);
else{
h[codeUsed++] = new Element(pcode, s[size]);
output(ccode);
pcode = ccode;
}while(true);
out.close();
in.close();
public static void main(String [] args) throws IOException{
setFiles(args);
decompress();if(messageNotWellFormatted("File access to /res folder before decompression"){
retry();
}else{
answerTo(post.getProfile());
}retry with the formatting tips !!!!! -
Save jpeg2000 with Photoshop CS4 using VB
Hello,
I want use Photoshop CS4 to convert different files to JPEG2000. I copied the jpeg2000-plugin to the plugin-folder but can I use the plugin within VisualBasic(2008)?
Greetings
GeorgThere are some difficulties saving the jpeg2000 file. When i save a jpeg2000 file via the menu of photoshop it is working correct. When i try this by using the vbscriptinglistener values from this save, the file will save as jpeg2000 but when i check the parameters via kakadu the layers parameter is
changed from 1 into 6. Does anybody know the solution to get this working ok ?
Regards Jan
Winbatch script
objApp = CreateObject("Photoshop.Application")
Image = "D:\DATA\JP2\0002.JP2"
ImageNew = "D:\DATA\JP2\0002.JP2"
docRef = objApp.Open(Image)
dialogMode = 3
idsave = objApp.CharIDToTypeID( "save" )
desc4 = CreateObject( "Photoshop.ActionDescriptor" )
idAs = objApp.CharIDToTypeID( "As " )
desc5 = CreateObject( "Photoshop.ActionDescriptor" )
layers = objApp.ActiveDocument.Layers.Count
Message("layers=",layers)
idJPLS = objApp.CharIDToTypeID( "JPLS" )
desc5.PutBoolean(idJPLS,@False)
idJPFM = objApp.CharIDToTypeID( "JPFM" )
desc5.PutBoolean( idJPFM, @True )
idJPMD = objApp.CharIDToTypeID( "JPMD" )
desc5.PutBoolean( idJPMD, @True )
idJPTP = objApp.CharIDToTypeID( "JPTP" )
desc5.PutBoolean( idJPTP, @False )
idJPJC = objApp.CharIDToTypeID( "JPJC" )
desc5.PutBoolean( idJPJC, @True )
idJPEH = objApp.CharIDToTypeID( "JPEH" )
desc5.PutInteger( idJPEH, 50 )
idJPPO = objApp.CharIDToTypeID( "JPPO" )
desc5.PutInteger( idJPPO, 0 )
idJPCS = objApp.CharIDToTypeID( "JPCS" )
desc5.PutBoolean( idJPCS, @True )
idJPWF = objApp.CharIDToTypeID( "JPWF" )
desc5.PutInteger( idJPWF, 0 )
idJPTS = objApp.CharIDToTypeID( "JPTS" )
desc5.PutInteger( idJPTS, 0 )
idJPJX = objApp.CharIDToTypeID( "JPJX" )
desc5.PutBoolean( idJPJX, @False)
idJPXM = objApp.CharIDToTypeID( "JPXM" )
desc5.PutBoolean( idJPXM, @True)
idJPEX = objApp.CharIDToTypeID( "JPEX" )
desc5.PutBoolean( idJPEX, @True )
idJPIP = objApp.CharIDToTypeID( "JPIP" )
desc5.PutBoolean( idJPIP, @True )
idJPRP = objApp.CharIDToTypeID( "JPRP" )
desc5.PutBoolean( idJPRP, @True)
idJPEV = objApp.CharIDToTypeID( "JPEV" )
desc5.PutInteger( idJPEV, 0 )
idJPIS = objApp.CharIDToTypeID( "JPIS" )
desc5.PutInteger( idJPIS, 1 )
idJPRS = objApp.CharIDToTypeID( "JPRS" )
desc5.PutInteger( idJPRS, 1 )
idJPEGtwozerozerozero = objApp.StringIDToTypeID( " JPEG 2000" )
desc4.PutObject( idAs, idJPEGtwozerozerozero, desc5 )
idIn = objApp.CharIDToTypeID( "In " )
desc4.PutPath( idIn, ImageNew)
objApp.ExecuteAction( idsave, desc4, dialogMode )
layers = objApp.ActiveDocument.Layers.Count
Message("layers=",layers)
objApp = CreateObject("Photoshop.Application")
dialogMode = 3
idCls = objApp.CharIDToTypeID( "Cls " )
objApp.ExecuteAction( idCls, , dialogMode )
ObjApp.Quit
Save via the menu Photoshop -
How do I save an image in a BufferedImage as a lossy JPEG2000 image?
New to Java! OK, I know how to save it as lossless. What I have so far is:
Iterator writers = ImageIO.getImageWritersByFormatName("JPEG2000");
ImageWriter writer = (ImageWriter)writers.next();
J2KImageWriteParam J2KWriteParam = new J2KImageWriteParam();
J2KWriteParam.setFilter("FILTER_97");
J2KWriteParam.setEncodingRate(0.9); // ??
J2KWriteParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); // ?
What do I do next to save the image? I don't understand how to apply J2KImageWriteParam. My images are all 16 bit gray scale and I want to apply just a little compression.
Thanks
NateOpen the movie with Quicktime Player 7 and go to the File ➙ Export menu. There select Export ➙ Movie to Picture and Use ➙ either jpeg or png.
I'm sure you can do it in iMovie but I don't use the latest version of iMovie so can't help there.
OT -
Video Import Problem: Decompressing?
So I have had Premiere Pro for a couple months now and I don't know why this problem is happening now when it wasn't a few days ago. I try to import my video file (.mpg) and it gives me this error: "There was an error decompressing audio or video." Will someone please help me?
FAQ: Why are some codecs and sequence presets missing from my installation of Premiere Pro?
-
Adobe Acrobat X shows artifacts with JPEG2000 PDF
Hi ,
I have a PDF which has a JPEG2000 compressed image inside it. When I view the image in Adobe Acrobat X it shows a lot of artifacts and noise. These artifacts are not present in the JPEG2000 image. Also if I open the PDF in another non-Adobe viewer the PDF appears clean without any of the artefacts. Can anyone please tell me if I can do something to see the image without artefacts in Acrobat?
Thanks,
ShamAs your question is about Acrobat and this is the Reader forum, you may be better off asking in the Acrobat forum:
http://forums.adobe.com/community/acrobat -
How to compress and decompress a pdf file in java
I have a PDF file ,
what i want to do is I need a lossless compression technique to compress and decompress that file,
Please help me to do so,
I am always worried about this topicHere is a simple program that does the compression bit.
static void compressFile(String compressedFilePath, String filePathTobeCompressed)
try
ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(compressedFilePath));
File file = new File(filePathTobeCompressed);
int iSize = (int) file.length();
byte[] readBuffer = new byte[iSize];
int bytesIn = 0;
FileInputStream fileInputStream = new FileInputStream(file);
ZipEntry zipEntry = new ZipEntry(file.getPath());
zipOutputStream.putNextEntry(zipEntry);
while((bytesIn = (fileInputStream.read(readBuffer))) != -1)
zipOutputStream.write(readBuffer, 0, bytesIn);
fileInputStream.close();
zipOutputStream.close();
catch (FileNotFoundException e)
catch (IOException e)
// TODO Auto-generated catch block
e.printStackTrace();
} -
CRM SYSFAIL - Error when decompressing during Import
Hi All,
We are getting error in SMQ2 "Error when decompressing during Import"
in Function module BAPI_CRM_SAVE and status is SYSFAIL. We are having CRM 4.0 and patch level 7.
Please see the source code extract
001920 ********************************************************************
001930 * define a little macro to add a table name to l_t_tables
001940 DEFINE lmacro_add_import_table.
001950 l_t_tables-name = 'T_&1&2&3&4'.
001960 l_t_tables-itabname = 'C_S_BLOCK-T_&1&2&3&4'.
001970 append l_t_tables.
001980 END-OF-DEFINITION.
001990 * define which tables have to be imported
002000 macro_execute: lmacro_add_import_table.
002010 lmacro_add_import_table:
002020 m h d r,
002030 p a r 1,
002040 p a r 2.
002050 * carry out the IMPORT statement to decompress data
> IMPORT (l_t_tables)
002070 FROM DATABASE baldat(al)
002080 ID i_s_ldat-log_handle
002090 USING baldat_import
002100 IGNORING CONVERSION ERRORS.
002110
002120 ENDFORM. "log_block_decompress
Thanks & Regards
SujithHi Andersen,
You should be a system administrator to do above task.
Deepak Jangra -
Cannot add TV commercial .mpg file to encoder - error while decompressing source
Hello!
I'm attempting to add a .mpg file to the CS5 Media Encoder but receive the error "Error while decompressing the source file". This file was recorded and is being used as a TV commercial. Would this mean that the file has a different encoding/compression that makes it impossible for the Encoder to decompress? I'm stumped because It is a .mpg file, which should be accepted. I've attempted adding other .mpg files and have no trouble. Is there any way around this?
Thank you, in advance, for your help!
Best Regards,
Kathyi think we should file a bug report through here with adobe premiere pro cs 5 as program.. anyway this is what i wrote:
******BUG******
Concise problem statement:
Steps to reproduce bug:
1. Open Adobe Media Encoder CS5
2. Add/Import an ".mpg" video file from Sony Camera DSC-W50 (used high quality format setting in camera) to Adobe Media Encoder CS5
3. Click open in the explorer window that appears to select video
Results: "Error while decompressing the source file"
Expected results: Open the file and start qeue to process -
How do I decompress a string in java?
The string is compressed with zip and is encoded base64.
I decocoded the string, I copied the string to a zip file and I tryed to decompress using the sample script(class UnZip2) from here: http://java.sun.com/developer/technicalArticles/Programming/compression/.
The error is
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at UnZip2.main(UnZip2.java:12)
Decompression works with other archives.
I know the string is ok because the server where I send it makes a succesful decompression.user10878887 wrote:
The string is compressed with zip and is encoded base64.
I decocoded the string, I copied the string to a zip file Expanding on the other reply...
It is likely that the problem is that the contents of the file incorrect.
Your statement suggests that you wrote the base64 string to the file. That would be wrong.
You needed to decode from base64 and then write the bytes to the file. -
Hi,
with release 10.1.4. of Adobe Acrobat, support of scanned and embedded jpeg2000-images by Adobe Acrobat has obviously gotten much worse !? Whereas with version 10.1.3 everything was OK, Acrobat can neither display nor print a lot of jpeg2000 images due to "insufficient data". Also export images to tiff or other formats does not work anymore. As mentioned, the same files / images were opened and displayed and exported correctly in Version 10.1.3. I have checked whether there are syntax or other errors in the named file (the answer is no). This occurs obviously with files created or treated by Acrobat itself as well as many other software creating pdfs with embedded jpeg2000. I hope this bug will be fixed as soon as possible, cause on the base of my understanding, this is a bug in Adobe Acrobat and maybe Adobe Reader too. Jpeg2000 is used in the whole world by many users and created by many software companies on the base of an ISO-certified standard. Note: the files are pdf/a 2b files! At the moment the alternative is to leave pdf and to go back to tif-images or pdfs with embedded ZIP-TIF-Files with exploding storage space needs. Does anybody know already about this issue?
Thanks for your help!I uploaded a pdf-Portfolio with examples in Acrobat.com. The Portfolio contains
a pdf generated directly by a scanner-software embedding jpeg2000-images with gentle jpeg2000-compression. The scanner is professional (costs more than 100 K$)
a pdf/a 2b version file from the scanned pdf (1.). The pdf/a conversion was - by the way - not done using Acrobat-Preflight, cause the process pdf/a 2b of Acrobat Preflight changes the greyscale images to RGB (why?).
a pdf/a 2b with lossless jpeg2000 conversion of an uncompressed tif previously exported by Acrobat 10.1.3 (without problems) out of example 1. Also this pdf/a 2b is not created with Adobe Acrobat, cause batch clipping of tif-subfolders to one pdf for each folder is - unfortunately - not part yet of my Acrobat-Skills. I am still forced to use another tool for that one.
Reproduce bug: Open the file with Adobe Acrobat 10.1.4.: Zoom the image to 150%, try to print, try to export the image as tif. Note: all the files or images are decoded correctly by 10.1.3., so that zooming, printing, exporting is working just fine.
URL: https://acrobat.com/#d=1blaLcFPbb1YtodAThb3uw
The document is now shared to public viewing.
Help us: I guess that Billions of documents are stored with jpeg2000-compression, which is as far as I am concerned - a reasonable strategy for a good balance between storage costs and image quality. To read them and work on them, I personally still prefer Adobe products. Good luck! -
How to save an image from canvas to jpeg2000 format?
good day! i would like some help about jj2000. i wish to save an image from canvas to a jpeg2000 format file. how will i do it using the jj2000? i just need to save it to a file.
please help!!!
thank you in advance!
lrdsI am not familiar with Jpeg2000, but the easiest way I've found to go from Java to a JPeg file is with Java Adavanced Imaging (JAI) package from Sun. Take a look at it and see if it meets your requirements.
-
I have an error message, decompressing audio or video file, how do I fix it?
I have an error message, decompressing audio or video file, how do I fix it?
Hi carjam222,
Please mention some more details regarding your issue. Check the link below.
http://forums.adobe.com/thread/961741
Regards,
Vinay
Maybe you are looking for
-
I have been trying to get on chat with adobe, since it seems that is the only option? and have not had any success for days, any ideas how to get support???? Thanks! Amy
-
Weblogic Portal 10.3.5 - JSR-168 Portlet resize at runtime by the users
One of the requirement I'm trying to develop in WLP 10.3.5 for JSR-168 Portlet is to give the end user the flexibilty to resize (Just like we can do in Iframe in IE) it in runtime. Is it possible to do this ? Any helpful link / pointers are welcome.
-
Soft I/O error in ASM disk volume when using iostat commmand
Dear All, We are having 2 node 11g rac/sun solaris 10/ASM storage, when we using iostat in node 2 getting soft I/O error keep on increasing. s/w h/w trn tot device *82 0 0 82 c4t600A0B80006766CD000003DF4B20A7FCd0* s/w h/w trn tot device 0 0 0 0 md/d1
-
Post a parked invoice in the background (MIR4)
Hi, I need to post a parked invoice that was parked with function BAPI_INCOMINGINVOICE_PARK. I wrote a program which uses BDC to post this invoice with ( transaction MIR4 post button ). It runs fine in the foreground but cannot run in the background
-
Inner classes in Binary tree program
hi everybody I am having trouble understanding the following lines of code: <code> public Enumeration elementsLevelOrder() { return new Enumeration() { private Queue q = new QueueArray(); { // initialise the queue q.enqueue(NodeTree.this); public boo