This is how you should use it:
In[1]:= img = RandomImage[1, {200, 300}, "Byte", ColorSpace -> "RGB"];
In[2]:= FileSize[Export["out.jp2", img, "ImageEncoding" -> "JPEG2000", CompressionLevel -> #]] & /@ {0.2, 0.5, 0.8}
Out[2]= {Quantity[144.878, "Kilobytes"], Quantity[91.122, "Kilobytes"], Quantity[36.79, "Kilobytes"]}
Notice that CompressionLevel
option is ignored when "ImageEncoding" -> "Lossless"
:
In[3]:= FileSize[Export["out.jp2", img, "ImageEncoding" -> "Lossless", CompressionLevel -> #]] & /@ {0.2, 0.5, 0.8}
Out[3]= {Quantity[200.226, "Kilobytes"], Quantity[200.226, "Kilobytes"], Quantity[200.226, "Kilobytes"]}