Announcement

Collapse
No announcement yet.

Resize images from command line

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Resize images from command line

    I have a large number of images in multiple directories that I wish to convert to a smaller file size so they use less file space. I can use Batch Conversion using the settings in the image. How can I do the same from a command line?

    NB I still don't fully understand the difference between "resizing" where you set the width/height in pixels, and changing the actual size on disk, which is what I want to do.

    Thanks

    #2
    Resizing changes the number of pixels in the image, reducing the resolution of the image.
    Resampling keeps the same number of pixels, but reduces the quality of the image.
    Either or both will reduce the size of the image on disk.
    Assuming that all of the images start out as JPG images of the same pixel dimensions, e.g. taken by the same camera, you should resample them to the desired quality using the slider at the top of the dialog. Resampling them to a target size on disk in kbytes will not get the best results. Some types of images, e.g. seascapes can be compressed more with less loss of quality, than other types of images, e.g. machinery, buildings, or text. Pure text images are best saved as lossless PNG, which gives the smallest file size on disk with no loss of quality.

    Click image for larger version

Name:	Quality Compression Tradeoff.png
Views:	621
Size:	153.6 KB
ID:	91533
    Last edited by Bhikkhu Pesala; 31.05.2021, 07:44 AM.
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      Compare the file size and quality of the attached images.

      Attached Files
      Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

      Comment


        #4
        Thanks for your replies. My main problem is I have hundreds of images to resize - I want to upload them to my website and use them in slideshows. So i was hoping i could find a way to do the resizing using a batch file which consists of IrfanView commands.
        Thanks

        Comment


          #5
          • Sure, you can do it with a batch job, but don't use the set file size option.
          • Pick an average compression value that works well for most images.
          • For optimal results you could sort the images into two or three folders and run two or three batch jobs.
          • Whatever, do not overwrite your original images; output to a temporary folder.
          • Run a batch job with a few images and check the results to see if you need to adjust the quality. Remove EXIF and IPTC unless you need them. You probably don't need to use the Advanced Batch Options.
          • Disabling chroma subsampling increases file sizes significantly.
          Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

          Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

          Comment

          Working...
          X