Page 1 of 1

JPEG 2K max_filesize

Posted: Wed Apr 22, 2020 7:50 am
by Hanysix
I want to compress several images in a loop to J2K with desired output filesize. This filesize is calculated based on input image and changes each loop.

I've noticed that XnView MP allows me to compress several images into 1 specific filesize, however I have to manualy write this filesize, which is fine for images that have the same resolusion and for a small number of filesizes I want to achieve.

In Nconvert there is an option called -max_filesize value: Maximum filesize (JPEG2K).

But when I use a testing code in PowerShell for 1 image, no matter what the value is, the output has always the same size.

Code: Select all

.\nconvert.exe -out jp2 -o test.j2k -max_filesize 1000 test.jpg

I am using 64bits version of NConvert.

Re: JPEG 2K max_filesize

Posted: Thu Apr 23, 2020 2:57 pm
by xnview
if you add -q 0?

Re: JPEG 2K max_filesize

Posted: Fri Apr 24, 2020 9:49 am
by Hanysix
Yes, that worked.

Also the size is considered to be in kilobytes, not bytes.

Re: JPEG 2K max_filesize

Posted: Fri Apr 24, 2020 10:14 am
by cday
Hanysix wrote: Fri Apr 24, 2020 9:49 am Yes, that worked.

Also the size is considered to be in kilobytes, not bytes.
@Pierre

Could the NConvert help file please be updated to incorporate theses two additions:

Code: Select all

-q value          : JPEG/FPX/WIC/PDF quality (default : 85) 
to include JPEG2000

and for JPEG2000 must the value be set to '0' ?

Code: Select all

-max_filesize value: Maximum filesize (JPEG2K)
to include kilobytes

Re: JPEG 2K max_filesize

Posted: Sun Apr 26, 2020 1:35 pm
by xnview
cday wrote: Fri Apr 24, 2020 10:14 am
Hanysix wrote: Fri Apr 24, 2020 9:49 am Yes, that worked.

Also the size is considered to be in kilobytes, not bytes.
@Pierre

Could the NConvert help file please be updated to incorporate theses two additions:
yes