Announcement

Collapse
No announcement yet.

Batch resizing — add pre-resizing width & height as overlay text?

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

    Batch resizing — add pre-resizing width & height as overlay text?

    Hello!

    I'm about to batch convert a set of high resolution images into low resolution copies, and wish to have the original, or pre-resized image width and height printed on the batch resized image as overlay text. Is it so, that only post-resizing width and height (using $W and $H) may be added through overlay text?

    Is there a possibility to insert overlay texts from a text file — or have the overlay text inserted from a command line interface (having extracted the individual image sizes beforehand)?

    Sorry if these things have been dealt with before, I did try to search the forum and FAQ for "overlay", but had no luck.

    pekka

    #2
    Just run two batch jobs. Resize and compress to the desired quality. Then add overlay text and save with original quality (estimated).
    Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      Originally posted by Bhikkhu Pesala View Post
      Just run two batch jobs. Resize and compress to the desired quality. Then add overlay text and save with original quality (estimated).
      Sorry, you lost me! Could you please elaborate? I don't quite follow your idea...

      What I'm after is this: I have dozens of 700 to 4000 px wide/tall scanned photos that I need to resize, all into 800 px, and add overlay text telling the original (pre-resized) width and height (700 ... 4000 px) on this 800 px wide reduced copy. I wish all resized copies to have about the same font size (12 px font) overlay text. There is no EXIF data to pick the original size from resized versions.

      pekka

      Comment


        #4
        Forget my previous post. I should have done a test run. The $W $H parameters take the size of the resized image, so you should add the overlay text in the first batch job, then compress and resize in the second. However, the text will be a different size depending on how much each image is resized. Are you making all images 800 pixels wide?
        Last edited by Bhikkhu Pesala; 15.02.2021, 01:23 PM.
        Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

        Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

        Comment


          #5
          Originally posted by Bhikkhu Pesala View Post
          Are you making all images 800 pixels wide?
          Yep!

          I was just hoping there was a switch somewhere in Irfanview — or a command line fearture to extract width and height and on another run inject those texts while resizing.

          I can take "no-can-do" as an answer

          pekka

          Comment


            #6
            Hang in there. Others may have suggestions.
            Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

            Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

            Comment


              #7
              I hope Imagemagick is not a four-letter-word here. I finally did it this way:

              At original file folder I run a command:
              Code:
              magick identify *.jpg > text.txt
              I got a txt file that contained amongst other things the image size:
              Code:
              PICTURE_01.jpg JPEG 2577x1710 2577x1710+0+0 8-bit Gray 256c 682177B 0.016u 0:00.006
              PICTURE_02.JPG JPEG 1659x2367 1659x2367+0+0 8-bit Gray 256c 632230B 0.000u 0:00.000
              PICTURE_03.JPG JPEG 2756x2164 2756x2164+0+0 8-bit Gray 256c 1020.81KiB 0.000u 0:00.000
              PICTURE_04.JPG JPEG 2761x3752 2761x3752+0+0 8-bit Gray 256c 1.10554MiB 0.000u 0:00.000
              ...
              I then resized the images in a batch using IrfanView!

              I opened the text.txt file and replaced spaces with tabs and copied that into LibreOffice Calc.

              I then wrote (using the "inspiration—perspiration" method and Google) the following cell command:
              Code:
              ="convert "&A1&"  -fill white  -undercolor #00000080  -gravity South -pointsize 24 -annotate +0+5  """&C1&"px"""&"  -gravity south -append  "&A1
              This resulted cell contents like:
              Code:
              convert PICTURE_01.jpg -fill white -undercolor #00000080 -gravity South -pointsize 24 -annotate +0+5 "2577x1710px" -gravity south -append PICTURE_01.jpg
              convert PICTURE_02.JPG -fill white -undercolor #00000080 -gravity South -pointsize 24 -annotate +0+5 "1659x2367px" -gravity south -append PICTURE_02.JPG
              convert PICTURE_03.JPG -fill white -undercolor #00000080 -gravity South -pointsize 24 -annotate +0+5 "2756x2164px" -gravity south -append PICTURE_03.JPG
              ...
              I then copied the lot to command prompt and got it done

              Bhikkhu — thanks for trying hard!

              pekka
              Last edited by Dm5; 15.02.2021, 06:10 PM.

              Comment


                #8
                Originally posted by Dm5 View Post
                Bhikkhu — thanks for trying hard!
                My mum said I can be very trying, but I obviously wasn't trying enough. ?

                Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

                Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                Comment


                  #9
                  No, No! Honestly — I was just too impatient

                  I'm an old redundant web master, and to me doing the job manually wasn't quite me. I tried very very hard not to do it with Perl. And I did it

                  I wish Irfanview may one day save me from doing this again by providing pre-batch width and height to be used in overlay text. Maybe — one day — no?

                  pekka

                  Comment

                  Working...
                  X