List Info

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




command line vs. API: postscript UGLY! HELP!
country flaguser name
United States
2007-03-31 09:59:09
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!

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


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?

package require TclMagick
package require TkMagick
package require Img

set wa1 [magick create wand]
set OUTFILE API
set TMPFILE $OUTFILE-orig.ps

$wa1 ReadImage $TMPFILE
$wa1 trim
$wa1 previous

set wa2 [$wa1 clone]
set wa3 [$wa1 clone]
set wa4 [$wa1 clone]
set wa5 [$wa1 clone]

$wa1 resample 100 100 undefined 0.0
$wa2 resample 125 125 undefined 0.0
$wa3 resample 150 150 undefined 0.0
$wa4 resample 300 300 undefined 0.0

$wa1 WriteImage $OUTFILE.png
$wa2 WriteImage $OUTFILE-1.png
$wa3 WriteImage $OUTFILE-2.png
$wa4 WriteImage $OUTFILE.ps




_______________________________________________
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-01 18:45:48
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

[1-2]

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