Irfanview; Command line option /jpgq

  • Thread starter Thread starter Hans-Guenter Kleff
  • Start date Start date
H

Hans-Guenter Kleff

Hello,

I try to set the quality of a scanned graphic with the command line
option /jpgq . For example:

C:\Programs\IrfanView\i_view32.exe /scan /jpgq=50;
/convert=d:\graphics\scantry.jpg

But the quality stays always the same as it is preset in the program.

Is my syntax wrong? Or what else has to be done?


Hans-Guenter Kleff
 
Hans-Guenter Kleff said:
Hello,

I try to set the quality of a scanned graphic with the command line
option /jpgq . For example:

C:\Programs\IrfanView\i_view32.exe /scan /jpgq=50;
/convert=d:\graphics\scantry.jpg

But the quality stays always the same as it is preset in the program.

Is my syntax wrong? Or what else has to be done?


Hans-Guenter Kleff

Hi Hans,
I updated my Irfanview (from 3.75) and reviewed the expanded command
list.
I haven't tried any of this yet, so let the reader beware.

I believe your syntax does have a couple of errors:
a) The ';' (semi-colon) at the end of line 1 probably shouldn't be
there. In your example, your are only calling "i_view32.exe" once,
and that may be confusing to what options to execute.

b) Depending on your scanner's file type defaults, you may need to
convert the original scan to a '.jpg' before you try using the
"/jpgq" option.

If you can set the scanner default to '.jpg' OR select '.jpg' with
the /scan (NOT hidden) option, then your example (without the
semi-colon) 'might' work:
C:\Programs\IrfanView\i_view32.exe /scan /jpgq=50
/convert=d:\graphics\scantry.jpg


Otherwise you could try it with one command combining the two steps
(at your own risk of course ;)
C:\Programs\IrfanView\i_view32.exe /scanhidden
/convert=d:\graphics\scantry.jpg /jpgq=50
/convert=d:\graphics\scan50.jpg

OR maybe a safer two step method :)

C:\Programs\IrfanView\i_view32.exe /scanhidden
/convert=d:\graphics\scantry.jpg
C:\Programs\IrfanView\i_view32.exe d:\graphics\scantry.jpg /jpgq=50
/convert=d:\graphics\scan50.jpg

Like I said, I haven't tried any of these myself, so Good Luck.

Cheers,
tomZ

--
If you spam my mailbox, you agree to accept any response I deem
appropriate.
Keep SIGNATURE AGREEMENT before replying.
"Any business model that relies on 'caveat emptor' is not ethical."
(aka Sony)
This posting may not be reversed engineered. My keyboard is proprietary.
 
Hello tomZ,

I believe your syntax does have a couple of errors:
a) The ';' (semi-colon) at the end of line 1 probably shouldn't be
there.

The original syntax has no semicolon. I wanted to show that all the
syntax is one line.
In your example, your are only calling "i_view32.exe" once,
and that may be confusing to what options to execute.

I call Irfanview only once because under "Notes" I read "You can
combine several options in one command". Is this wrong?
b) Depending on your scanner's file type defaults, you may need to
convert the original scan to a '.jpg' before you try using the
"/jpgq" option.

I found no way to set my scanner's (Canoscan 4200F) file type
defaults.

Anyway I didn't know, that there is already a "file type" as long as
the graphic isn't stored yet.
Otherwise you could try it with one command combining the two steps
(at your own risk of course ;)
C:\Programs\IrfanView\i_view32.exe /scanhidden
/convert=d:\graphics\scantry.jpg /jpgq=50
/convert=d:\graphics\scan50.jpg

This works fine for me but has a major disadvantage: The scan is
really hidden, I get the scanner's menu no more and I cannot control
the cut-out on the scanner's glass.

So I tried:
C:\Programs\IrfanView\i_view32.exe /scanhidden
/convert=d:\graphics\scantry.jpg /jpgq=50
/convert=d:\graphics\scan50.jpg

It doesn't work.

What would be your syntax if I still want to get the scanner menu?

Thanks in advantage

Hans-Günter Kleff
 
Hans-Guenter Kleff said:
Hello tomZ,



The original syntax has no semicolon. I wanted to show that all the
syntax is one line.


I call Irfanview only once because under "Notes" I read "You can
combine several options in one command". Is this wrong?


I found no way to set my scanner's (Canoscan 4200F) file type
defaults.

Anyway I didn't know, that there is already a "file type" as long as
the graphic isn't stored yet.


This works fine for me but has a major disadvantage: The scan is
really hidden, I get the scanner's menu no more and I cannot control
the cut-out on the scanner's glass.

So I tried:
C:\Programs\IrfanView\i_view32.exe /scanhidden
/convert=d:\graphics\scantry.jpg /jpgq=50
/convert=d:\graphics\scan50.jpg

It doesn't work.

What would be your syntax if I still want to get the scanner menu?

Thanks in advantage

Hans-Günter Kleff


To get to the scanner menu:
C:\Programs\IrfanView\i_view32.exe /scan

A full list of options, and examples, is in the "i_options.txt" file
in the Irfanview directory,
and in the Help file -> Index -> "Command line options" .

It looks like you want to:
1) From the scanner interface, CROP (cut-out) the image on the
scanner's display.
2) Reduce the image's quality by 50%
3) Save as a '.jpg'

I tried those steps with my scanner and the following command line
options DO work to reduce the jpg quality by 50%:
C:\Programs\IrfanView\i_view32.exe /scan /jpgq=50
/convert=c:\temp\scan50.jpg

I suggest you also run:
C:\Programs\IrfanView\i_view32.exe /scan /convert=c:\temp\scan100.jpg

and compare the two file sizes.

Cheers,
tomZ

--
If you spam my mailbox, you agree to accept any response I deem
appropriate.
Keep SIGNATURE AGREEMENT before replying.
"Any business model that relies on 'caveat emptor' is not ethical."
(aka Sony)
This posting may not be reversed engineered. My keyboard is proprietary.
 
Hllo tomZ

It looks like you want to:
1) From the scanner interface, CROP (cut-out) the image on the
scanner's display.
2) Reduce the image's quality by 50%
3) Save as a '.jpg'

Yes exactly.
I tried those steps with my scanner and the following command line
options DO work to reduce the jpg quality by 50%:
C:\Programs\IrfanView\i_view32.exe /scan /jpgq=50
/convert=c:\temp\scan50.jpg

I suggest you also run:
C:\Programs\IrfanView\i_view32.exe /scan /convert=c:\temp\scan100.jpg

and compare the two file sizes.

I followed exactly your suggestions, but scan50.jpg and scan100.jpg
have the same size and quality.

Evidently the scan quality stays how is it preset in Irfanview's
"Save as" menu: When I have scanned a graphic "by hand" while
Irfanview is open and stored the quality during "Save as", the next
automatic command line scan has exactly the same quality.

As I told in my previous posting the scan quality is not influenced
with "/scan" but only with "/scanhidden" and that's what makes me
crazy.
 
Hans-Guenter Kleff said:
Hllo tomZ



Yes exactly.


I followed exactly your suggestions, but scan50.jpg and scan100.jpg
have the same size and quality.

Evidently the scan quality stays how is it preset in Irfanview's
"Save as" menu: When I have scanned a graphic "by hand" while
Irfanview is open and stored the quality during "Save as", the next
automatic command line scan has exactly the same quality.
Hmmmm, I didn't have Irfanview open when I made my test/comments :/

When I ran the command, the scanner window opened for scanning, and
when the scan completed, "Irfanview" was listed as where the image
was to go.
After I cropped the image and hit 'Send the scan' the scanner
closed, and the rest of the command(s) were executed in the
background (only a small window briefly opened showing the progress).

Irfanview was never "open" at any time, and maybe that's where
there's a conflict in saving options.

Since there is an Irfanview option to [force "only one instance"] ,
perhaps that indicates only one instance should be running when
(some) commands options are used.
As I told in my previous posting the scan quality is not influenced
with "/scan" but only with "/scanhidden" and that's what makes me
crazy.

I've been learning this process with you while testing the command
options.
Sorry if I haven't been able to help resolve your problem.

Cheers,
tom

--
If you spam my mailbox, you agree to accept any response I deem
appropriate.
Keep SIGNATURE AGREEMENT before replying.
"Any business model that relies on 'caveat emptor' is not ethical."
(aka Sony)
This posting may not be reversed engineered. My keyboard is proprietary.
 
Dear Tom

I've been learning this process with you while testing the command
options.
Sorry if I haven't been able to help resolve your problem.

It is clear now , that Irfanview stores JPG's with the same quality as
it is preset in the previous scan as well by a menu scan as with a
command line "/scan". "/scan" doesn't work together with "/jpgq".
Only "/scanhidden" reacts differently.

Neverteheless I found a way to get the wanted result:

1. Create a dummy test.jpg and save it.

2. Run "C:\Programs\IrfanView\i_view32.exe /jpgq/=100
/convert=c:\temp\test.jpg"
Note: This makes sure that the preset scan quality is 100

3. Run "C:\Programs\IrfanView\i_view32.exe
/convert=c:\temp\myscan.jpg"
Note: Create myscan.jpg with quality=100

4. Run "C:\Programs\IrfanView\i_view32.exe /jpgq=50
/convert=c:\temp\myscan.jpg"
Note: Convert the quality of myscan.jpg to 50

With step 4 Irfanview's JPG-Quality is set to 50. To get the next scan
with quality 100 you need a new
"/jpgq/=100 /convert=c:\temp\test.jpg"

Cheers

Hans-Guenter
 
Back
Top