Group Abstract Group Abstract

Message Boards Message Boards

Convert .jp2 image to .png increase image size significantly

Attachment

Attachments:
POSTED BY: Wenzhen Zhu

PNG uses different compression algorithm than JPEG2000, but here are some ideas that you can try.

Input file:

In[1]:= file = "ExampleData/girl.jp2";
In[2]:= i = Import[file];
In[3]:= FileSize[FindFile[file]]
Out[3]= Quantity[10.909, "Kilobytes"]

Export with default settings:

In[4]:= FileSize[Export["out1.png", i]]
Out[4]= Quantity[53.595, "Kilobytes"]

Binarize image before exporting:

In[5]:= FileSize[Export["out2.png", Binarize[i]]]
Out[5]= Quantity[1.321, "Kilobytes"]

Use color palette of length 8:

In[6]:= FileSize[Export["out3.png", i, "ColorMapLength" -> 8]]
Out[6]= Quantity[6.269, "Kilobytes"]
POSTED BY: Piotr Wendykier
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard