RE: FOP output to TIFF

2003-03-14 Thread David Blevins
Oleg,

Me again.  Making excellent progress.  Based on your advice and some
study time digging in the code, I was able to get the right sized
images, using the right compression, and output to a new tiff file per
FO page.  Thank you very much, I am in your debt.

The last thing that remains is fixing the white on black issue. 

These show a black background/white foreground:
 - Adobe Photoshop 6.0
 - Apple QuickTime 6 PictureViewer
 - Microsoft Imaging Preview

These show a white background/black foreground:
 - Adobe Acrobat 4
 - Adobe ImageReady 3.0

Unfortunately, this is an add-on to a preexisting process that already
has several gigs of TIFF images in an optical store, all of which show
up the opposite as the ones I am creating.  Regardless of the viewer, I
will need to somehow flip the black to white.

Any idea on how to make this change?  I've been trying to forcefully
change the image type in the encoder from TIFF_BILEVEL_BLACK_IS_ZERO to
TIFF_BILEVEL_WHITE_IS_ZERO.  Seems to have no effect.  Maybe I'm not
going about that in the right way or maybe I'm on the wrong track
altogether.

-David

 -Original Message-
 From: Oleg Tkachenko [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, March 05, 2003 5:23 AM
 To: [EMAIL PROTECTED]
 Subject: Re: FOP output to TIFF
 
 
 David Blevins wrote:
 
  Multithreaded access isn't a requirement, so we are in the clear 
  there. The requirements are simple:
  
  1. TIFFs must use comp group 3x or greater
  2. Must be able to set (or even hardcode) the width and height. 3. 
  Must be able to split each page of the XSL-FO doc into 
 separate TIFF 
  files.
 Well, FOP and TIFFRenderer support 1 and 2, but number 3 
 requires specialized 
 TIFFRenderer. That's quite easy actually, all one has to do 
 is to override 
 stopRenderer() method and instead of encoding every page 
 images into the same 
 output stream create new output stream for each one. Look at 
 TIFFRenderer 
 sources, that's easy. May be I can find a time to make it 
 myself this weekend.
 
  2. XSL-FO to TIFF using your TIFFRenderer.  Meets requirement 1, 
  though still getting black backgrounds.  Using Photoshop 
 and QuickTime 
  to view the output.
 Hmm, it's ok for me in Adobe Photoshop, are you sure it's 
 inverted in Photoshop?
 
This might be an easy thing to reverse if I knew which
  section of the code needed changing.
 It's hardcoded in TIFF encoder code now, a volunteer is 
 needed to make it 
 parametrizable, I'll try probably.
 
If that were resolved, I would
  still need a solution for requirements 2 and 3.
 Well, requirement 2 is just XSL-FO's page-height/page-width 
 properties I think.
 
 -- 
 Oleg Tkachenko
 Multiconn Technologies, Israel
 
 
 -
 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]



RE: FOP output to TIFF

2003-03-04 Thread David Blevins
Thanks for the reply Oleg,

Multithreaded access isn't a requirement, so we are in the clear there.
The requirements are simple:

1. TIFFs must use comp group 3x or greater
2. Must be able to set (or even hardcode) the width and height.
3. Must be able to split each page of the XSL-FO doc into separate
TIFF files.

That's it.

I've tried:
1. XSL-FO to SVG to TIFF using FOP and Batik.  Meets requirements 2 and
3 nicely but not 1.  The generated TIFF files are more than two meg at
the required width and height.

2. XSL-FO to TIFF using your TIFFRenderer.  Meets requirement 1, though
still getting black backgrounds.  Using Photoshop and QuickTime to view
the output.  This might be an easy thing to reverse if I knew which
section of the code needed changing.  If that were resolved, I would
still need a solution for requirements 2 and 3.

3. XSL-FO to SVG to TIFF using FOP and Batik hacked to use your
TIFFImageEncoder.  Was really hoping this would get me the compression
capabilities (requirement 1) while retaining the ability to do
requirements 2 and 3.  Unfortunately, it didn't work.  It can generate
uncompressed TIFFs just fine, but trying any compression generates
invalid TIFF files about 2k in size.


At this point, I'm not sure what direction to go next.  It seems like
your code is the simplest.  If we could work out a solution between the
two of us, I would be more than happy to code it up and contribute the
code.

Best regards,
David


Oleg Tkachenko olegt () multiconn ! com wrote:
 
 Hello!
 
 David Blevins david.blevins () visi ! com wrote:
  Now I have my first question, so here goes.  What is the 
 recommended 
  approach to generate a TIFF output: using the SVGRenderer then 
  transcoding to TIFF with batik; using the TIFFRenderer written by 
  Oleg?
 Hard question. TIFFRenderer has some flaws: it is not 
 thread-safe, because 
 AWTRenderer isn't. Another its problem is that all generated 
 page images are 
 held in memory. Both issues I hope will be fixed in FOP 
 1.0dev. So may be 
 SVGRenderer is a prefered approach at the moment.
 
  The TIFFRenderer works, however the outputted TIFF is white text on 
  black background (should be the other way around).  Maybe there is 
  something I need to configure correctly.
 Well, which TIFF viewer are you using? AFAIK, there is a 
 great mess amongst 
 TIFF viewers what is white and what is black in b/w FAX 
 compressed images, 
 e.g. consider given black-and-white TIFF image, Adobe 
 Photoshop and Windows 
 Imaging will show it differently black on white or white on black. 
 TIFFRenderer uses JAI encoder, which seems to be agree with 
 Adobe in this 
 question, so I always rely on Photoshop and Alternatiff 
 plugin and never got 
 inverted image.
 Actually I've been thinking about introducing such a 
 parameter to TIFFRenderer 
 to allow control over that. Ok, granted, will try this week.
 
  There also doesn't seem to any new versions of the 
 TIFFRenderer.  The 
  latest I can find is 0.9 from May last year.  Is this there an 
  updated, unreleased version somewhere?
 Well, I just don't see how can I make it better, it's quite 
 simple wrapper, 
 which heavily rely on JAI encoder and AWTRenderer. Now, when 
 I'm FOP committer 
 I'd better be focused on how to make FOP itself better, 
 TIFFRenderer will 
 benefit from it also.
 
 -- 
 Oleg Tkachenko
 Multiconn Technologies, Israel
 
 
 -
 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]



RE: FOP output to TIFF

2003-03-04 Thread David Blevins
Title: Message



Thanks 
for the feedback.

Unfortunately, the black vs. white things is not up to my 
interpretation. This is part of an already existing and heavily used 
document archival application (written in VB). So it's too late to change 
requirements.

What 
workaround did you use for number 3?

Thanks,
David

  
  -Original Message-From: Rob Stote 
  [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 
  12:23 PMTo: '[EMAIL PROTECTED]'Subject: RE: FOP 
  output to TIFF
  David: 
  I ran into many of the same issues you did rendering to 
  TIFF. I used Oleg's TiffRenderer: The Black and White thing is really a Windows imaging issue. I got 
  around this by using Alternatiff browser plug-in, or viewing my TIFF's on a 
  non-windows based machine. (in my case a solaris box - image tool).
  I could never solve your issue 3, if you get an answer please 
  let me know. I would be willing to help as much as I can. 
  Rob 
  -Original Message- From: David 
  Blevins [mailto:[EMAIL PROTECTED]] 
  Sent: March 4, 2003 1:46 PM To: 
  [EMAIL PROTECTED] Subject: RE: FOP output to 
  TIFF 
  Thanks for the reply Oleg, 
  Multithreaded access isn't a requirement, so we are in the 
  clear there. The requirements are simple: 
  1. TIFFs must use comp group 3x or greater 2. Must be able to set (or even hardcode) the width and height. 
  3. Must be able to split each "page" of the XSL-FO doc into 
  separate TIFF files. 
  That's it. 
  I've tried: 1. XSL-FO to SVG to TIFF 
  using FOP and Batik. Meets requirements 2 and 3 
  nicely but not 1. The generated TIFF files are more than two meg 
  at the required width and height. 
  2. XSL-FO to TIFF using your TIFFRenderer. Meets 
  requirement 1, though still getting black 
  backgrounds. Using Photoshop and QuickTime to view the output. This might be an easy thing to reverse if I knew 
  which section of the code needed changing. If 
  that were resolved, I would still need a solution for 
  requirements 2 and 3. 
  3. XSL-FO to SVG to TIFF using FOP and Batik hacked to use 
  your TIFFImageEncoder. Was really hoping this 
  would get me the compression capabilities (requirement 
  1) while retaining the ability to do requirements 2 
  and 3. Unfortunately, it didn't work. It can generate 
  uncompressed TIFFs just fine, but trying any compression 
  generates invalid TIFF files about 2k in size. 
  
  At this point, I'm not sure what direction to go next. 
  It seems like your code is the simplest. If we 
  could work out a solution between the two of us, I 
  would be more than happy to code it up and contribute the code. 
  Best regards, David 
  Oleg Tkachenko olegt () multiconn ! com wrote: 
Hello!   "David Blevins" david.blevins () 
  visi ! com wrote:   Now I have my first 
  question, so here goes. What is the  
  recommended   approach to generate a TIFF 
  output: using the SVGRenderer then   
  transcoding to TIFF with batik; using the TIFFRenderer written by 
Oleg?  Hard 
  question. TIFFRenderer has some flaws: it is not  
  thread-safe, because  AWTRenderer isn't. Another 
  its problem is that all generated  page images are 
   held in memory. Both issues I hope will be fixed 
  in FOP  1.0dev. So may be  SVGRenderer is a prefered approach at the moment.The TIFFRenderer works, however 
  the outputted TIFF is white text on   black 
  background (should be the other way around). Maybe there is 
something I need to configure 
  correctly.  Well, which TIFF viewer are you using? 
  AFAIK, there is a  great mess amongst 
   TIFF viewers what is white and what is black in 
  b/w FAX  compressed images,  e.g. consider given black-and-white TIFF image, Adobe 
   Photoshop and Windows  Imaging will show it differently black on white or white on black. 
   TIFFRenderer uses JAI encoder, which seems to be 
  agree with  Adobe in this  question, so I always rely on Photoshop and Alternatiff 
   plugin and never got  
  inverted image.  Actually I've been thinking about 
  introducing such a  parameter to TIFFRenderer 
   to allow control over that. Ok, granted, will try 
  this week.
  There also doesn't seem to any new versions of the  TIFFRenderer. The   latest I 
  can find is 0.9 from May last year. Is this there an   updated, unreleased version somewhere?  Well, I just don't see how can I make it better, it's quite 
   simple wrapper,  
  which heavily rely on JAI encoder and AWTRenderer. Now, when  I'm FOP committer  I'd better be 
  focused on how to make FOP itself better,  
  TIFFRenderer will  benefit from it also. 
--  Oleg Tkachenko  Multiconn 
  Technologies, Israel   
   
  - 
   To unsubscribe, e-mail: 
  [EMAIL PROTECTED]  For 
  additional commands, e-mail: [EMAIL PROTECTED]  
  - 
  To unsubscribe, e-mail: 
  [EMAIL PROTECTED] For additional

FOP output to TIFF

2003-02-20 Thread David Blevins
Hello All,

I've been using FOP on various things for a few months now and have
never needed to join the list and ask a question -- a sign of good
software.  I has the same experience with Ant, look there that is now.
Hats off to FOP, it's a very valuable tool.

Now I have my first question, so here goes.  What is the recommended
approach to generate a TIFF output: using the SVGRenderer then
transcoding to TIFF with batik; using the TIFFRenderer written by Oleg?

The TIFFRenderer works, however the outputted TIFF is white text on
black background (should be the other way around).  Maybe there is
something I need to configure correctly.  

I started with this approach with the idea that it would not require me
to do the full XML-FO -- SVG -- TIFF translation and go straight from
FO to TIFF.  This is an assumption on my part, I wouldn't be surprised
if SVG was still used as an interim format.  Some information on that
would be good.

There also doesn't seem to any new versions of the TIFFRenderer.  The
latest I can find is 0.9 from May last year.  Is this there an updated,
unreleased version somewhere?

Thanks,

David Blevins


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