techno info wrote:

i tried putting the COLOR_ID as COLOR_ID_YCbCrA ,but still it throws the same error.
> may be something i am doing wrong..

Can you post your current code as a standalone example?

reg writing a rendered image to remove alpha any links provided will be of great help. many thanks

Well there are a number of examples in sources/org/apache/batik/ext/awt/image/rendered

  Your best bet will probably to implement this as a 'background color'
operation, so the user can provide a solid color to "fill in" the
transparent regions.  The easiest way to do this would be to wrap
the two (source w/ Alpha, and generated w/o alpha) rasters (which is
what rendered images compute) into BufferedImages (simply provide the
ColorModel from the RenderedImage) Then fill the dest with the solid color
and draw the source BufferedImage over the dest.

On Fri, 24 Oct 2003 Thomas DeWeese wrote :

techno info wrote:


hi thomas,
many thanks,i did modify the code that takes the band.
i am getting the floowing error
/*
Exception breakpoint occurred at line 158 of JPEGParam.java.
java.lang.IllegalArgumentException: NumComponents not in sync with COLOR_ID

Ooops, sorry, the SVG Image has alpha so you will either need to write a small renderedImage to remove the Alpha (way beyond the scope of this list) or use COLOR_ID_YCbCrA (The 'A' is for Alpha).


*/ i also noticed that Abstractred.getSampleModel i.e im.getSampleModel() is fetching 
no value.
i might be doing something wrong.

On Fri, 24 Oct 2003 Thomas DeWeese wrote :


Hi Techno,

 This is pretty close, but I would use the getDefaultJPEGEncodeParam
that takes a number of bands:

jpegColorID = com.sun.image.codec.jpeg.JPEGDecodeParam.COLOR_ID_YCbCr;
jpegEncodeParam = com.sun.image.codec.jpeg.JPEGCodec.getDefaultJPEGEncodeParam
                    (im.getSampleModel().getNumBands(), jpegColorID);



techno info wrote:



hi thomas,
correct if i am wrong,is this way i create???.
/*
jpegColorID =
                  com.sun.image.codec.jpeg.JPEGDecodeParam.COLOR_ID_YCbCr;

Raster tile00 = im.getTile(0, 0);

jpegEncodeParam =                
com.sun.image.codec.jpeg.JPEGCodec.getDefaultJPEGEncodeParam(
                  tile00, jpegColorID);
*/

On Thu, 23 Oct 2003 Thomas DeWeese wrote :



techno info wrote:




i am facing with similar problem of memory outburst when i try to convert svg to jpg. 
i tried the solution mentioned by you earlier
to GVS.infact i am getting a null pointer exception. In the encode
method of TIFFImageEncoder,it is calling encodeParam.getJPEGEncodeParam() to get the 
JPEGEncodeParam.the value of JPEGEncodeParam is coming as null.

So did you try providing a JPEGEncodeParam? As I said I've never actually used these TIFF formats.




/*
Exception breakpoint occurred at line 441 of TIFFImageEncoder.java.
java.lang.NullPointerException: java.lang.NullPointerException int 
org.apache.batik.ext.awt.image.codec.tiff.TIFFImageEncoder.encode(java.awt.image.RenderedImage,
 org.apache.batik.ext.awt.image.codec.tiff.TIFFEncodeParam, int, boolean) 
TIFFImageEncoder.java:441 void 
org.apache.batik.ext.awt.image.codec.tiff.TIFFImageEncoder.encode(java.awt.image.RenderedImage)
 TIFFImageEncoder.java:164 void 
org.apache.batik.apps.tiledTranscoder.TiledImageTranscoder.transcode(org.w3c.dom.Document,
 java.lang.String, org.apache.batik.transcoder.TranscoderOutput) 
TiledImageTranscoder.java:76 void 
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(org.apache.batik.transcoder.TranscoderInput,
 org.apache.batik.transcoder.TranscoderOutput) XMLAbstractTranscoder.java:174 void 
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(org.apache.batik.transcoder.TranscoderInput,
 org.apache.batik.transcoder.TranscoderOutput) SVGAbstractTranscoder.java:188


*/







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]








---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to