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 classloader <cl...@hotmail.com> on 2002/03/04 21:58:17 UTC

Re: SVG->PNG, background tranparency problem. Help please

Hi, Vincent,
I did use the latest version of Batik 1.1.1

Actually, my SVG file is very very small, I was wondering if I should specify something in SVG file or not (before the conversion) ?

Have been working on that for 3 days, always got white background, black one or other colors.(no matter how I change the option,   or the source code. ) Anyone has similar expeirence?
Thanks a lot,
Leo


Here is my SVG file content, anything wrong with it?
-------------
<svg>
<path d=" M 3 17 L 4 17 6 17 8 17 10 17 13 17 16 17 
19 18 21 18 25 18 26 18 28 18 29 18 31 19 32 19 33 19 
34 19 35 19 36 19 37 19 38 19 40 19 41 19 42 19 43 19 
44 19 44 18 45 18 46 17 47 16 47 15 47 14 48 13 48 12 
48 11 48 10 48 9 48 8 48 7 48 6 47 6 47 5 47 4 46 4 46 
3 45 3 44 3 43 3 42 3 41 3 40 3 39 3 38 3 37 3 37 4 36 
4 36 5 35 5 35 6 34 6 34 7 34 8 34 9 34 10 34 11 34 12 
34 13 34 14 34 15 34 16 34 17 34 18 34 19 34 20 34 21 
34 22 34 23 34 24 34 25 34 26 34 27 34 28 34 29 34 30 
33 31 33 32 32 32 32 33 31 33 30 33 29 33 28 33 28 32 
27 32 26 31 25 31 25 30 24 30 23 30 23 29 22 28 22 27 
22 26 23 26 25 25 26 25 27 25 28 25 29 25 30 25 31 25 
32 26 33 27 34 27 35 27 36 28 37 29 38 29 39 29 39 30 
40 31 40 32 41 32 41 33 41 34 41 35 41 36 41 37 41 38 
41 39 40 39 40 40 39 40 38 41 37 41 36 41 35 41 34 41 
33 41 32 41 32 42 31 42 30 42 29 42 28 43 27 43 26 43 
25 43 24 43 24 44 23 44 22 44 21 44 20 44 20 45 19 45 
18 45 17 45 15 45 14 45 12 45 10 45 9 45 8 45 " 
style="fill:none; 
       fill-opacity:1; 
       stroke:#ff0000; 
       stroke-width:3" />
</svg>
-------------

Re: SVG->PNG, background tranparency problem. Help please

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "c" == classloader  <cl...@hotmail.com> writes:

c> So the difference tells me: if the PNG is 32Bit(ARGB each 8bits)
c> format, IE will have trouble to view its transparent background. if
c> PNG is with poorer depth, IE can treat it correctly.

c> So it's IE's problem. ( I am using IE6. )

c> ==> New Problem, please help:

c> So, my next approach would be trying to use Batik to convert
c> SVG->PNG and specifying output file with 8 bits depth. I can't find
c> the options from the Batik Usage which can do that.  Then I added
c> one line in PNGTranscoder.java: "params.setBitDepth(8);" but the
c> generated file still have not-transparent background.  (I doubt
c> this way to do the modification, but I don't know how to do it.)

c> Could you tell me how to specify the output PNG file's depth? (I
c> have too limited image processing knowledge.)

   As one might imagine going from 32 bits per pixel to 8 bits per
pixel is a complicated thing.  Currently Batik does not do this.  You
may be able to use other command line tools to accomplish this (such
as ImageMagik (sp?)).  If someone wanted to contribute a good
palletizer to Batik I'm sure it would be welcome as many SVG files can
be palletized with little loss of quality if done properly.

c> BTW, I just tried above 2 pages with Netscape 6.2, both works well.

   I suggest you switch browsers :)


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


Re: SVG->PNG, background tranparency problem. Help please

Posted by classloader <cl...@hotmail.com>.
Hi, Thomas,
Thank you very much for the email. [I tried both JDK1.3 and JDK1.4, they
give me same result. I know Batik use JDK's classes like java.awt.Image,
etc. so I installed different JDK version on different machine. I guess this
issue is not problem of JDK.  Correct me if I was wrong.]

Situation changed, here is the story: I just figure out something, but I
still have problem and I hope I can get help from you. :-)

I spend many days on using Batik to do the SVG-> PNG conversion, trying to
get the transparent background, but the PNG I got was with white
background(or Black).   (I should say: "I always see the white background
from IE6."), please take a look at:
http://www.dynazone.com/SVG/movingNotTransparent.htm

I tried all kinds of approaches: change options, rewriting the Java source
code. No one works.

This afternoon, one friend gave me a hand, he used PhotoShop open that PNG
file which generated by Batik: It is with transparent ground. (Wow,
eventually I confirmed that it is the correct PNG file, although it can not
display correctly in IE.)
After some comparison, we found the we can see the transparent background if
we use Photoshop change the image properties from 32Bit true color to 256
color(8bit). Please go to:
http://www.dynazone.com/SVG/movingTransparent.htm  (the PNG file in this
page is different from the one in above link. this one PNG is changed by
Photoshop from the PNG in above link.)

So the difference tells me: if the PNG is 32Bit(ARGB each 8bits) format, IE
will have trouble to view its transparent background. if PNG is with poorer
depth, IE can treat it correctly.

So it's IE's problem. ( I am using IE6. )


==> New Problem, please help:

So, my next approach would be trying to use Batik to convert SVG->PNG and
specifying output file with 8 bits depth. I can't find the options from the
Batik Usage which can do that.  Then I added one line in PNGTranscoder.java:
"params.setBitDepth(8);" but the generated file still have not-transparent
background.
(I doubt this way to do the modification, but I don't know how to do it.)

Could you tell me how to specify the output PNG file's depth? (I have too
limited image processing knowledge.)

Thanks a lot,
Leo

BTW, I just tried above 2 pages with Netscape 6.2, both works well.





----- Original Message -----
From: "Thomas E Deweese" <th...@kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Monday, March 04, 2002 5:41 PM
Subject: Re: SVG->PNG, background tranparency problem. Help please


> >>>>> "c" == classloader  <cl...@hotmail.com> writes:
>
> c> Hi, Vincent, I did use the latest version of Batik 1.1.1
>
> c> Actually, my SVG file is very very small, I was wondering if I
> c> should specify something in SVG file or not (before the conversion)
> c> ?
>
> c> Have been working on that for 3 days, always got white background,
> c> black one or other colors.(no matter how I change the option, or
> c> the source code. ) Anyone has similar expeirence?  Thanks a lot,
> c> Leo
>
>    What version of the JRE are you using.  We just had a bug reported
> for JRE 1.4 which sounds like your problem.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>

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


Re: SVG->PNG, background tranparency problem. Help please

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "c" == classloader  <cl...@hotmail.com> writes:

c> Hi, Vincent, I did use the latest version of Batik 1.1.1

c> Actually, my SVG file is very very small, I was wondering if I
c> should specify something in SVG file or not (before the conversion)
c> ?

c> Have been working on that for 3 days, always got white background,
c> black one or other colors.(no matter how I change the option, or
c> the source code. ) Anyone has similar expeirence?  Thanks a lot,
c> Leo

   What version of the JRE are you using.  We just had a bug reported
for JRE 1.4 which sounds like your problem.


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


RE: SVG->PNG, background tranparency problem. Help please

Posted by Tangent <ta...@usa.net>.
I have the similar problem using JRE 1.4.  I have server status code as
405 when rasterizer attempts locate jpeg or gif images referenced by the
SVG file as well.
 
- Tangent
 

-----Original Message-----
From: classloader [mailto:classloader@hotmail.com] 
Sent: Monday, March 04, 2002 2:58 PM
To: batik-users@xml.apache.org
Subject: Re: SVG->PNG, background tranparency problem. Help please


Hi, Vincent,
I did use the latest version of Batik 1.1.1
 
Actually, my SVG file is very very small, I was wondering if I should
specify something in SVG file or not (before the conversion) ?
 
Have been working on that for 3 days, always got white background, black
one or other colors.(no matter how I change the option,   or the source
code. ) Anyone has similar expeirence?
Thanks a lot,
Leo
 
 
Here is my SVG file content, anything wrong with it?
-------------
<svg>
<path d=" M 3 17 L 4 17 6 17 8 17 10 17 13 17 16 17 
19 18 21 18 25 18 26 18 28 18 29 18 31 19 32 19 33 19 
34 19 35 19 36 19 37 19 38 19 40 19 41 19 42 19 43 19 
44 19 44 18 45 18 46 17 47 16 47 15 47 14 48 13 48 12 
48 11 48 10 48 9 48 8 48 7 48 6 47 6 47 5 47 4 46 4 46 
3 45 3 44 3 43 3 42 3 41 3 40 3 39 3 38 3 37 3 37 4 36 
4 36 5 35 5 35 6 34 6 34 7 34 8 34 9 34 10 34 11 34 12 
34 13 34 14 34 15 34 16 34 17 34 18 34 19 34 20 34 21 
34 22 34 23 34 24 34 25 34 26 34 27 34 28 34 29 34 30 
33 31 33 32 32 32 32 33 31 33 30 33 29 33 28 33 28 32 
27 32 26 31 25 31 25 30 24 30 23 30 23 29 22 28 22 27 
22 26 23 26 25 25 26 25 27 25 28 25 29 25 30 25 31 25 
32 26 33 27 34 27 35 27 36 28 37 29 38 29 39 29 39 30 
40 31 40 32 41 32 41 33 41 34 41 35 41 36 41 37 41 38 
41 39 40 39 40 40 39 40 38 41 37 41 36 41 35 41 34 41 
33 41 32 41 32 42 31 42 30 42 29 42 28 43 27 43 26 43 
25 43 24 43 24 44 23 44 22 44 21 44 20 44 20 45 19 45 
18 45 17 45 15 45 14 45 12 45 10 45 9 45 8 45 " 
style="fill:none; 
       fill-opacity:1; 
       stroke:#ff0000; 
       stroke-width:3" />
</svg>
-------------


RE: Batik Implementation in C#

Posted by Jeff Kowalczyk <jt...@adelphia.net>.
I do know that someone has been discussing a C# port of FOP in
fop-dev@xml.apache.org, but that he would be removing the Batik code
code to ease the porting process. C# should have the facilities to
handle the rasterizing and viewer jobs with GDI+, but I imagine that
most applications on the windows platform would just use the Adobe
viewer instead of writing a new viewer. Anyhow, it would be a pretty
divergent port, I would think. 

-----Original Message-----
From: Tangent [mailto:tangent@usa.net] 
Sent: Monday, March 04, 2002 6:41 PM
To: 'Batik Users'
Subject: Batik Implementation in C#


Hi,
 
I just wonder if any group or people working on or planning on
implementing Batik in C# or .Net platform.
 
Thanks!
 
- Tangent


Batik Implementation in C#

Posted by Tangent <ta...@usa.net>.
Hi,
 
I just wonder if any group or people working on or planning on
implementing Batik in C# or .Net platform.
 
Thanks!
 
- Tangent