List Info

Thread: Re: command line vs. API: postscript UGLY! HELP!




Re: command line vs. API: postscript UGLY! HELP!
country flaguser name
United States
2007-04-02 09:34:50

Close.. but apparently it is forcing me to load an image
first before
setting a resolution (which by then is too late to fix it.)

% $w SetResolution 300 300
Wand contains no images `MagickWand-1'

In your cmdline example, that works great except that it
resamples and
ruins the sharpness of the images.  I'll have to test them
to see if
they're scannable.

And yes, we DO want to convert these to raster.

Is there a way to force resolution on an empty wand so that
loading an
image into it won't change it?


> tomglimacorp.com on  wrote...
> | I have done due diligence and must admit defeat on
this.  If anyone is
> | knowledgeable and able to help graciously, I would
very much appreciate
> | it!  Please no "RTFM" or "If you had
only googled X" messages, as I have
> | done all due diligence and have pulled all my hair
out at this point.
> | Thanks to anyone who helps!
> |
> Read it all, and you will get the idea.
>
> | Here goes:
> |
> | Given a postscript file CmdLine-orig.ps (at
> | http://www.dentar.c
om/imagemagick for example), the following command
> | lines work exactly as I want:
> | convert -trim -density 100 +repage CmdLine-orig.ps
CmdLine.png
> | convert -trim -density 125 +repage CmdLine-orig.ps
CmdLine-1.png
> | convert -trim -density 150 +repage CmdLine-orig.ps
CmdLine-2.png
> | convert -trim -density 300 +repage CmdLine-orig.ps
CmdLine.ps
> |
> Your lucky the above does to what you want!  You could
read the image in
> before you trim.
>
> This will do it all in one command and at a much higher
quality
>
>    convert -density 600 CmdLine-orig.ps -trim +repage

>            ( +clone -resample 100  -write  CmdLine.png
  +delete ) 
>            ( +clone -resample 125  -write 
CmdLine-1.png +delete ) 
>            ( +clone -resample 150  -write 
CmdLine-2.png +delete ) 
>            ( +clone -resample 300  -write  CmdLine.ps 
  +delete ) 
>            null:
>
> See..
>   Postscript to Image
>     htt
p://www.imagemagick.org/Usage/text/#postscript
>   Writing an Images multiple times
>     http://
www.imagemagick.org/Usage/files/#write
>
> Note writing images to postscript will generate a
rasterized postscript
> image rather than a resizable postscript that the
origial postscript
> document.  See
>   A word about Vector Image formats
>     http
://www.imagemagick.org/Usage/formats/#vector
>
> | The TclMagick code below give me the sizes I want,
but all the crispness
> | is gone.  Just doing "SetDensity" results
in files whose sizes don't get
> | modified from the original like I want, but resample
results in
> | ugliness.  Just ReadImage and WriteImage ruins the
file's appearance, in
> | fact.  Can anyone help?
> |
>
> The Tcl script looks is doing the same as the above.
> Well almost.
>
> You do not specify the density for the initial read of
the image for
> the postscript to raster image conversion (see 'word
about vector
> formats').  As such it is probably defaulting to
'screen density'
> or only 72 dpi.   That is a major loss of quality!
>
> | $wa1 ReadImage $TMPFILE
> | $wa1 trim
> | $wa1 previous
>
> Try to find out how to set Density BEFORE the ReadImage
operation.
>
>   Anthony Thyssen ( System Programmer )   
<A.Thyssengriffith.edu.au>
> 
------------------------------------------------------------
-----------------
>      "A man without an address is a vagabond"
  -- George Bernard Shaw
> 
------------------------------------------------------------
-----------------
>      Anthony's Home is his Castle     http://www.cit.gu.
edu.au/~anthony/
> _______________________________________________
> Magick-users mailing list
> Magick-usersimagemagick.org
> http://studio.imagemagick.org/mailman/listinfo/magick
-users
>


_______________________________________________
Magick-users mailing list
Magick-usersimagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick
-users

Re: command line vs. API: postscript UGLY! HELP!
user name
2007-04-02 18:29:57
tomglimacorp.com on  wrote...
| 
| 
| Close.. but apparently it is forcing me to load an image
first before
| setting a resolution (which by then is too late to fix
it.)
| 
| % $w SetResolution 300 300
| Wand contains no images `MagickWand-1'
| 
| In your cmdline example, that works great except that it
resamples and
| ruins the sharpness of the images.  I'll have to test them
to see if
| they're scannable.
| 
| And yes, we DO want to convert these to raster.
| 
| Is there a way to force resolution on an empty wand so
that loading an
| image into it won't change it?
| 
Sorry I don't know how you would set the density before
reading in
Tcl MagicWand.

I think you may have to ask the IM forums, or see if you can
find who
looks after the Tcl WagicWand API.

  Anthony Thyssen ( System Programmer )    <A.Thyssengriffith.edu.au>
 -----------------------------------------------------------
------------------
  Anyone who slaps a  'This page is best viewed with Browser
X'  label
  on a Web page appears to be yearning for the bad old days,
before
  the Web, when you had very little chance of reading a
document written
  on another computer, another word processor, or another
network.
                                                   -- Tim
Berners-Lee, 1996
 -----------------------------------------------------------
------------------
     Anthony's Home is his Castle     http://www.cit.gu.
edu.au/~anthony/
_______________________________________________
Magick-users mailing list
Magick-usersimagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick
-users

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )