Results 1 to 8 of 8

Thread: please help with command line

  1. #1

    Default please help with command line

    I'm trying to figure out how to use the command line to change an image to grayscale.

    here is what I tried to run from a program code
    C:\Program Files\IrfanView\i_view32.exe/c:\ocr\open.gif/gray

    I got an error , so then I tries this
    "C:\Program Files\IrfanView\i_view32.exe"/c:\ocr\open.gif/gray

    Infraview opened but the file wasn't converted to grayscale

    so then I tried this
    "C:\Program Files\IrfanView\i_view32.exe"/c:\ocr\open.gif/gray=c:\ocr\open2.gif

    again infraview opened but nothing happened

    So I decided to run the line from the start>run window and all the lines above generated an error in windows xp

    Can these command lines be run from the Start>Run ?

    Is there something wrong with my syntax that they will not run from my program ?

    I also tried them from excel vba using the Shell command and had no luck , again I got errors ?

    Please help me understand what I am doing wrong with this .

    Also is it possible to change a file to grayscale without infraview opening ?

    Thank you for your help.

  2. #2
    Join Date
    May 2007
    Near Munich, Germany
    IrfanView 4.33
    64-bit Linux Distribution
    CPU Cores



    welcome here

    Try to use:

    "C:\Program Files\IrfanView\i_view32.exe" c:\ocr\open.gif /convert=c:\ocr\open2.gif /gray


  3. #3


    Steve thank you for replying.

    The line of code you provided does save a new file but it fails to change it to grayscale.

    There is a widow that comes up for an option to select a transparent color , and if you don't want that you hit escape.

    Is there a way to make sure that window doesn't show ?

    Why isn't my image being converted to gray scale ?

    What if I want to save the same file , just convert a file without creating a new file ?

  4. #4


    I enter the same path for both files in the line of code and it ran without error.

    C:\Program Files\IrfanView\i_view32.exe" c:\ocr\open.gif /convert=c:\ocr\open.gif /gray

    So that would seem to work if I could get to a point where it actually converts to gray scale

  5. #5


    I tried this

    "C:\Program Files\IrfanView\i_view32.exe" c:\ocr\open.gif /gray/convert=c:\ocr\open.gif

    It brings the image up in the infraview window and in gray scale but it doesn't save it.

    And I want to bypass all windows.
    Last edited by suitedaces; 23.02.2008 at 10:15 PM.

  6. #6


    Steve I got this to work as intended, the transparency window will not come up with jpg format.
    And I needed to make sure I had a space between jpg and gray and between gray and convert.

    RunProgram>C:\Program Files\IrfanView\i_view32.exe c:\ocr\o.jpg /gray /convert=c:\ocr\o60.jpg

    Again thanks for replying.

  7. #7


    I just found this thread and it helped me quite much.

    But I still have a question and I hope there is anybody who can help me.

    I'd like to convert raster images into grayscale in batch mode. It actually works with the code above however it only seems to convert into grayscale as long as the target format is JPG.
    I would like to have TIFF as target format. My batch runs but afterwards when I open the tif-file in gimp the mode is indexed.
    does the convertione to grayscale doesn't work for tiff-files?

  8. #8


    i solved my problem with an workaround: I have to chang a import parameter when I import the images into the database

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