Resize png 8 bits

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

Moderators: helmut, XnTriq, xnview

Post Reply
den1a
Posts: 3
Joined: Sat May 14, 2022 6:04 am

Resize png 8 bits

Post by den1a »

Hello. I want to crop the photo, but I get a poor quality photo. Please tell me how to fix the problem

Code: Select all

nconvert -overwrite -resize 1500 1200 -ratio -rflag decr image.png
Attachments
Cropped file
Cropped file
Original file
Original file
JeanMich
Posts: 2
Joined: Mon May 16, 2022 4:34 pm

Re: Resize png 8 bits

Post by JeanMich »

Hello,
I don't quite get it : you are not cropping anything here.

Whatever, I'm no expert but I'd try to add

Code: Select all

-out png -clevel 9  
to specify the output file format (png) and the compression level.

Code: Select all

 -overwrite -out png -clevel 9  -ratio -resize 1500 1200 -rflag decr 
It's giving me an image with the correct colors.
If you have different images from different sources, I'd add also something to deal with transparency, alpha chanel, metadata and so on to make smaller files.
cday
XnThusiast
Posts: 4394
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Resize png 8 bits

Post by cday »

The GUI software XnConvert, with it's Actions Preview, can provide an easy way to test different settings, but testing with 1.95 I haven't managed to obtain the desired result, no breakup of the image though.
den1a
Posts: 3
Joined: Sat May 14, 2022 6:04 am

Re: Resize png 8 bits

Post by den1a »

In my case, the problem was solved by adding a parameter -rtype quick

Code: Select all

nconvert -overwrite -resize 1500 1200 -ratio -rflag decr -rtype quick image.png
cday
XnThusiast
Posts: 4394
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Resize png 8 bits

Post by cday »

den1a wrote: Tue May 17, 2022 5:08 am In my case, the problem was solved by adding a parameter -rtype quick

Code: Select all

nconvert -overwrite -resize 1500 1200 -ratio -rflag decr -rtype quick image.png
Interesting...

Code: Select all

-rtype        : Type of resampling
          quick    : Quick resize
          linear   : Bi-linear (linear)
          hermite  : Hermite
          gaussian : Gaussian
          bell     : Bell
          bspline  : Bspline
          mitchell : Mitchell
          lanczos  : Lanczos
den1a
Posts: 3
Joined: Sat May 14, 2022 6:04 am

Re: Resize png 8 bits

Post by den1a »

Unusual, but it works :)
Thank you for responding!
Post Reply