Results 1 to 4 of 4

Thread: . how to save image using a script

  1. #1

    Default . how to save image using a script

    Hi + salutations

    This is may first post

    OS: Windows XP
    IVU version: .35 (the latest)



    ...\i_view32.exe u:\p.jpg /effect=(8,6)

    the above script works
    except I don not know how to save the modified image, scriptically.


    Saving sans manual interaction is crucial !
    Why ?
    because, eventually, I may put the above script in a cmd 'for loop', like :

    for %f in (10,20,30,40,50,60) do ...\i_view32.exe u:\p.jpg /effect=(8,%f)

    Additionally,
    I have zillions of images.

  2. #2
    Professional User Mij's Avatar
    Join Date
    Mar 2007
    Location
    Camberley, Surrey, UK
    Posts
    2,763
    Version
    IrfanView 4.51
    OS
    32-bit Win 10
    CPU Cores
    3

    Default

    Just add
    /convert=u:\p.jpg (or whatever you want to save it as)
    to the end of the line

    In your loop you could probably use something like
    /convert=u:\p_%f.jpg
    so that all the saved files have different names.

  3. #3

    Default

    Thanks Mij

    your helpful reply did work
    after a struggle:
    CAVEATs:
    1-all file names in a script seem to need an absolute path !!!
    2-for every PNG image
    i had to click on the background color i choose to make transparent.
    i always choose black for all images.
    So there was some annoying obligatory interaction

    Two (related ?) questions:

    1- Is there a list of what is/NOT
    scriptable in IRFANVIEW ?

    2- How to, scriptically,
    designate a color (say black) in a directory of PNG images
    as background ?
    Last edited by fanfan; 07.02.2013 at 02:34 PM. Reason: typos

  4. #4
    Professional User Mij's Avatar
    Join Date
    Mar 2007
    Location
    Camberley, Surrey, UK
    Posts
    2,763
    Version
    IrfanView 4.51
    OS
    32-bit Win 10
    CPU Cores
    3

    Default

    Yes you are correct that a script needs a full path name for both the Irfanview EXE file and the image file that it is to open. That is not an Irfanview requirement. It is the script host program that requires it. You do not necessarily need a full path name in the command options that are passed to Irfanview though. If you just have /convert=p.png for example, then Irfanview will assume that you want the output file in the folder where the image file was opened. You can also use a single period (.) to represent the folder where the Irfanview program i_view32.exe resides, or a double period (..) for its parent folder. That can be useful when you have everything, i.e. a copy of the program and all the images, together on a USB stick.

    As to your questions;
    1. The Help file contains the list and examples of all the command line options that Irfanview can accept from the script. What code you can put into the script to generate those command line options depends on what type of script you use. Irfanview cannot pass back variables to the script. Some of the options can save output information in a file though.

    2. When you save a PNG file you can set the PNG Save option (in the GUI) to use the Main Window color as the transparent color. You then do not need to select a color each time. You cannot change it using a script file unless you include in it code to edit the Irfanview initialisation file (i_view32.ini).
    Be aware though that if you open a jpg file to convert to a png, the image will contain many different shades of the background color in it and only one of them can be the same as the main window color. So it will not do what you probably want it to.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •