You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by florian <fl...@structbench.com> on 2002/03/06 18:50:17 UTC

svg measurements


hi!

im trying to rasterize a svg file with the following specs:

<svg width="12cm" height="12cm">

when i open the finished png though, the image is 15,98cm x 15,98cm big.

does anybody have a idea why?

i didnt set any dpi value. on another hand, when i do, batik seems
to ignore it totally and alwas render picture to with 72 dpi..

thanks alot! =)

ciao!
florian



-- 

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: svg measurements

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "f" == florian  <fl...@structbench.com> writes:

>> You may have a problem with the way you are using the rasterizer. I
>> just created an example (see attachment) and setting the -dpi
>> option does make a difference.

f> when i open the resulting tiff in photoshop, the resolution of the
f> tiff is still 72.  when i change the dpi value to 150 (without
f> resampling), the image is 11,99cm wide and heigh..

f> so im wondering why the rastizer doesnt give the resulting image
f> the right dpi value right away?

   We don't set the dpi tags in Tiff.  We should, I'll see about
fixing this.

f> and why the measurements are not 100% correct.. (11,99 cm instead
f> of 12 cm)

   Well first off you have a discrete coordinate system so given that
we are doing 150 dpi each pixel is 1/150'th of an inch so since we can
only output an integer number of pixels we are likely to be a little
over or a little under.  Also I noticed we don't round the eventually
width/height which would give us a tendency to be low (but we usually
can't be right on).


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: svg measurements

Posted by florian <fl...@structbench.com>.
>Florian,
>
>You may have a problem with the way you are using the rasterizer. I
>just created an example (see attachment) and setting the -dpi option
>does make a difference.

oops. you are right. it does make a difference. i rasterized your dpi.svg
like this:

java -jar batik-1.1.1/batik-rasterizer.jar -m image/tiff -dpi 150 dpi.svg



when i open the resulting tiff in photoshop, the resolution of the 
tiff is still 72.
when i change the dpi value to 150 (without resampling), the image is 11,99cm
wide and heigh..

so im wondering why the rastizer doesnt give the resulting image the right
dpi value right away?

and why the measurements are not 100% correct.. (11,99 cm instead of 12 cm)


thanks alot..

ciao!
florian




-- 

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: svg measurements

Posted by Vincent Hardy <vi...@sun.com>.
Florian,

You may have a problem with the way you are using the rasterizer. I
just created an example (see attachment) and setting the -dpi option
does make a difference.

Regards,
Vincent.

florian wrote:
> 
> hi!
> 
> im trying to rasterize a svg file with the following specs:
> 
> <svg width="12cm" height="12cm">
> 
> when i open the finished png though, the image is 15,98cm x 15,98cm big.
> 
> does anybody have a idea why?
> 
> i didnt set any dpi value. on another hand, when i do, batik seems
> to ignore it totally and alwas render picture to with 72 dpi..
> 
> thanks alot! =)
> 
> ciao!
> florian
> 
> --
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org