matlab code for JPEG2000

Can any one soon provide me matlab code for implementing JPEG2000 . Thank you in advance.

 Accepted Answer

Steven Lord
Steven Lord on 14 Nov 2018

0 votes

Just call imwrite with 'jp2' or 'jpx' as the fmt input argument.

6 Comments

N/A
N/A on 15 Nov 2018
Edited: madhan ravi on 15 Nov 2018
its is working for jpg but not for jp2 or jpx
following error is coming--
??? Error using ==> imwrite
Invalid input syntax
Error in ==> jpeg2000impt at 2
imwrite(X,'newImage.jp2','jp2')
Thank you
imwrite(X,'newImage.jp2')
That should be accepted in current matlab . which release are you using ?
N/A
N/A on 15 Nov 2018
I am using version 7.0.0.19920 (R14)
N/A
N/A on 15 Nov 2018
sir can you you help me in this @walter-roberson?
Thank you.
No, I cannot assist you with that. See Legal Problems

Sign in to comment.

More Answers (1)

N/A
N/A on 15 Nov 2018
If possible then Can any one do it for me as I dont have new version.
It will be a great help, please do it.
I am attaching required files --
thank you in advance.
X = imread('C:\work\Lena.png');
imwrite(X,'newImage.jp2','jp2','Comment','My JPEG2000 file')
imfinfo('newImage.jp2')
imfinfo('Lena.png')
Lena.png

6 Comments

>> imfinfo('newImage.jp2')
ans =
struct with fields:
Filename: '/Users/roberson/MATLAB/4/429/429805/newImage.jp2'
FileModDate: '15-Nov-2018 12:22:28'
FileSize: 331669
Format: 'JP2'
FormatVersion: []
Width: 512
Height: 509
BitDepth: 24
ColorType: 'truecolor'
BitsPerSample: [8 8 8]
CodeBlockDims: [64 64]
CodestreamComponents: 3
CodestreamProfile: 'PROFILE2'
ColorSpace: 'sRGB'
Comments: {'My JPEG2000 file'}
ChannelDefinition: {3×3 cell}
ImageStartLocation: [1 1]
NumberOfTiles: 1
ProgressionOrder: 'LRCP: Layer, Resolution, Component, Position'
QualityLayers: 1
TileSize: [509 512]
WaveletDecompositionLevels: 4
WaveletKernel: '9x7'
WidthSubSampling: [1 1 1]
HeightSubSampling: [1 1 1]
>> imfinfo('index.png')
ans =
struct with fields:
Filename: '/Users/roberson/MATLAB/4/429/429805/index.png'
FileModDate: '15-Nov-2018 12:19:52'
FileSize: 236547
Format: 'png'
FormatVersion: []
Width: 512
Height: 509
BitDepth: 24
ColorType: 'truecolor'
FormatSignature: [137 80 78 71 13 10 26 10]
Colormap: []
Histogram: []
InterlaceType: 'none'
Transparency: 'none'
SimpleTransparencyData: []
BackgroundColor: []
RenderingIntent: []
Chromaticities: []
Gamma: 0.454549998044968
XResolution: []
YResolution: []
ResolutionUnit: []
XOffset: []
YOffset: []
OffsetUnit: []
SignificantBits: []
ImageModTime: []
Title: []
Author: []
Description: []
Copyright: []
CreationTime: []
Software: []
Disclaimer: []
Warning: []
Source: []
Comment: []
OtherText: []
I notice the jp2 is larger than the png.
N/A
N/A on 15 Nov 2018
Thank you so much sir for this. I will be in debt for this great help.
Please do one last favour can you please share the resultant newimage with me. Actually I need it to show comparison with JPEG and JPEG2000.
Thank you once again.
Walter Roberson
Walter Roberson on 15 Nov 2018
Edited: Walter Roberson on 15 Nov 2018
R2010a or later for JPEG 2000 support.
Your R14 (7.0.0) is over 14 years old. Time for you to upgrade.
N/A
N/A on 15 Nov 2018
Okay .
thank you sir.

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products

Release

R2014a

Tags

Asked:

N/A
on 14 Nov 2018

Commented:

N/A
on 15 Nov 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!