JPEG 2K max_filesize

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

Hanysix
Posts: 5
Joined: Wed Apr 08, 2020 6:26 am

JPEG 2K max_filesize

Post 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.
User avatar
xnview
Author of XnView
Posts: 44451
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: JPEG 2K max_filesize

Post by xnview »

if you add -q 0?
Pierre.
Hanysix
Posts: 5
Joined: Wed Apr 08, 2020 6:26 am

Re: JPEG 2K max_filesize

Post by Hanysix »

Yes, that worked.

Also the size is considered to be in kilobytes, not bytes.
cday
XnThusiast
Posts: 4132
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: JPEG 2K max_filesize

Post 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
User avatar
xnview
Author of XnView
Posts: 44451
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: JPEG 2K max_filesize

Post 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
Pierre.