Converting to PDF & Transparency Issue (Need Answer ASAP!)

Post questions on how to use or achieve an effect in Inkscape.
Missy
Posts: 12
Joined: Fri Apr 09, 2010 9:49 am

Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby Missy » Sun May 09, 2010 6:15 am

Hi there,

I am trying to convert SVG illustrations (with text embedded) into a PDF in order to upload to Lulu.com as an e-book. I was told by Lulu.com to convert the SVG image/text into a JPEG and then convert to PDF (ensuring that the font is embedded). Every time I attempt to go through the process they recommended to embed the fonts and/or convert the image/text into a PDF, an error notice occurs. It reads as follows. "Problems During PDF Export: PDF/A forbids transparency. A transparent object was painted opaque instead." What do I need to do to correct this?

P.S. Please note that as I was drawing the picture of a sun in my illustration, I did use one of the tools on the left hand side of Inkscape (the tool that enables you to create perfect circles, ellipses & arcs) to create it and filled the sun in with the color yellow. Without a white background, the sun appears transparent unlike the rest of the illustration. Is using that tool the issue? If so, how do I make the color yellow opaque (even though it appears yellow with a white background)?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby brynn » Sun May 09, 2010 8:15 am

I'm not sure I completely understand your problem. Actually it's not clear to me that you have a problem. If that's an exact quote of the error message, it's just telling you that if you intended to have something transparent in your image, it's no longer transparent. As long as you're getting your PDF doc, and it looks like you want it to, I think you can just ignore the error message. (I often get an error message when converting SVG to PDF using Inkscape. Not your same message, I usually get a different one. But as long as my PDF looks like I want, I just close out the message box.)

No the shapes tools don't inherently carry any transparency. That would have to happen in the Fill, when you applied the yellow color. But JPEG doesn't support transparency, so if you accidentally applied any transparency, the conversion to JPEG would have wiped it out and created solid color.

Or are you saying that when you complete the conversion to PDF, the sun IS transparent, but you wanted it opaque? If that's the case, could you please upload your SVG as an attachment to your reply? Did you use Object menu > Clip or Mask, or any path operations (Difference, Exclusion, etc.)? Also if you could clarify the problem -- what's not happening that you want to happen (or vice versa :P )?

Missy
Posts: 12
Joined: Fri Apr 09, 2010 9:49 am

Re: Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby Missy » Sun May 09, 2010 6:05 pm

Hi Brynn,

THANK YOU so much for responding quickly. Yes, I'm getting the image I want (the sun is opaque which is what I want), but I was very concerned about the warning (especially because this is the first time I've gone through this process and I'm not absolute as to what's normal). I have additional questions:

1) When converting a PNG to a JPEG via Open Office Draw, there is a box that pops open and gives the following JPEG options: a) choose "Quality 1 - 100" and b) "Color Resolution: grayscale or true colors", what is the best response to each of those?

2) For comparison, I created a PDF using a PNG image (which resulted in the error message I mentioned in my previous text) and a JPEG (no error message...perhaps due to my changing the "Quality" from 75, the default in Open Office, to 100). It "appears" to me that the PNG has a higher quality to it. Is that because when one converts from a PNG to a JPEG to a PDF that the quality diminishes the more times there is a conversion? And the sales rep at Lulu.com was the one who told me I need to upload the images as JPEG PDF's, however, Lulu's website says their e-book software supports PNG images. I'm contacting Lulu on Monday to double-check the info. In the meantime, do you have any thoughts on this?

3) Since you said that JPEG doesn't support transparency, would it be safer to have the image as a JPEG (so if I accidentally applied any transparency, the conversion to JPEG would wipe it out and create a solid color)?

4) According to Lulu.com's website, in order to upload a book as an e-book, it states the following:

a) If you are printing a color book that has black & white images in it, the black & white images should have the colorspace set to grayscale.
b) The gamma of a grayscale image should be between 2.2 and 2.4.

Where would I look in Inkscape to ensure that my images (wherever there are black & white images) meet those standards before uploading?

P.S. I apologize if this is the 2nd response to your reply, but I wasn't quite sure if the first one went through the system correctly.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby brynn » Mon May 10, 2010 7:56 am

Oh gee, I'm not sure if I can answer all of these. But I'm sure others will be able to fill gaps in my knowledge for you.

1 - I've never used Open Office, although I probably will install it on this new laptop. For the JPEG quality, I would go with whatever the dialog is prompting (since I'm not sure what the proper quality should be). On the color resolution, grayscale would be for images that are black, gray and white. Since you said your sun is yellow, you would want to choose true colors.

2 - I'm not sure about that, that the more times you convert to another format, there's a reduction in quality. I know that with some conversions, there definitely is a risk of some loss in quality. I know that, because often when I try to change a format in GIMP, I get a warning that it may result in some kind of loss. In some cases, the image does get wacky, in others it's a subtle loss, and in others, no problem. But I haven't enough experience to learn which conversions always cause a loss.

Each image format has it's own....pluses and minuses, I guess. It all depends on how you want to use the image. The biggest difference between PNG and JPG is that PNG supports transparency and JPG does not. Therefore, PNG may be better used in non-photo web graphics (like for icons, eg). But JPG, in my understanding, is better suited for print and high resolution photo type web graphics. PNG is better to use if size/space is an issue on the web, because they are compressed and often have a tiny filesize. But with JPG....actually I'm not positive about this, but it's my impression, that the higher resolution, the larger the filesize. Anyway, you could search Wiki for info on differences among file formats.

And the sales rep at Lulu.com was the one who told me I need to upload the images as JPEG PDF's, however, Lulu's website says their e-book software supports PNG images.

If it says it supports PNG, that simply means PNG is one of the formats that can be used. If it says PNG and PNG only, then maybe the sales rep is misinformed. (A sales rep may not be the best person to consult for technical support.) Or maybe the book is out of date. If it doesn't exclude JPG specifically, it's probaby ok to use JPG. But you should not need to convert SVG to PNG to JPG to PDF. You should be able to do SVG to PNG to PDF, or SVG to JPG to PDF, although I've only begun to learn about making PDFs. If you'd like to search the forums, there's an excellent topic on converting SVG to PDF. I can't remember all the details at the moment, but Scribus was recommended for me (another Open Source program like Inkscape). I'm sorry I don't have the link to the topic, but I'll look for it after I post this, and edit in the link later.

3 - No, because PDF doesn't support transparency either. So no matter if you converted to PNG or JPG, when you convert to PDF, transparency is lost.

4 - This one I can't answer. I don't think there are such settings in Inkscape, and it's probably because Inkscape creates vector graphics. Those type of settings I've seen in GIMP, a raster graphics program. So I'm guessing that those specifications are given to the image during the conversion from SVG to PNG or JPG. ....hhm....After you convert from SVG to whatever, what program are you using to convert to PDF? I'm thinking that is where you need to look up the grayscale settings. I'm guessing, probably, those are standard or maybe even default settings...and you'd probably be ok leaving where the conversion process set them. But I'm not at all positive about this one.

I'm sure others will join in and offer more suggestions. But since you said you're in a hurry, I thought I'd share what little I know about your issue. I think what most would be helpful for them, is to know the other program you're using to do the final PDF conversion.

Good luck with your project. I hope it turns out great :D

Edit -- Here's a link to that other topic I mentioned. Not everything in it will apply to your problem, but some of the discussion might be helpful.
viewtopic.php?f=5&t=4256

Missy
Posts: 12
Joined: Fri Apr 09, 2010 9:49 am

Re: Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby Missy » Mon May 10, 2010 1:47 pm

Hi Brynn,

Thank you for responding to ALL my questions and thoroughly -- very helpful! I also read up on the link you sent me and Scribus "may" be another route for me to go. I wasn't aware of that program (I'll check it out!). I have a feeling that one of the two ways I described previously will work, however. And I like the advice you gave to Lila. It's a relief to know that the "trial and error" method is being used by others :-).

As I said above, I'm going to double-check with Lulu.com tomorrow and see if it's necessary to convert from PNG to JPEG (then to PDF) and that will clear up that issue. In answer to your question, "After you convert from SVG to whatever, what program are you using to convert to PDF?", I am using Open Office. It has a drop-down menu whereby you can export directly as a PDF. Very handy! I really like Open Office and encourage you to take a look at it.

IF you don't hear from me again on this topic, you'll know I successfully uploaded the book on to Lulu's website :-).

Thank you again for your time, patience and input!

Missy
Posts: 12
Joined: Fri Apr 09, 2010 9:49 am

Re: Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby Missy » Mon May 10, 2010 3:10 pm

Brynn,

One other thing. In your previous posting, you said, "But you should not need to convert SVG to PNG to JPG to PDF. You should be able to do SVG to PNG to PDF, or SVG to JPG to PDF, although I've only begun to learn about making PDFs". Converting from SVG to PNG to PDF works (everything is intact), HOWEVER, after the Lulu sales rep said I needed to upload in JPG (which, as you said, he may be misinformed), I tried that (going from SVG to JPG to PDF). To my surprise, though, the yellow color in the sun was missing. So then I decided to include the PNG step (SVG to PNG to JPG to PDF) and the yellow color returned. Now that I've explained that, your thoughts?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby brynn » Mon May 10, 2010 5:33 pm

I tried that (going from SVG to JPG to PDF). To my surprise, though, the yellow color in the sun was missing. So then I decided to include the PNG step (SVG to PNG to JPG to PDF) and the yellow color returned. Now that I've explained that, your thoughts?

That is weird, to me anyway. Maybe it makes perfect sense to those who are more familiar with this process. I could be wrong about PDF not supporting transparency. But if the SVG to JPG to PDF actually made the sun transparent, I'm positive that the SVG to JPG should have eliminated any transparency.

Maybe you've got something funky going on in your original SVG file? I know from personal experience that bumbling around trying to learn how to do something in Inkscape, I actually can do some pretty weird things. Maybe I got it to work, but sometimes not in the proper way. So maybe you got it to work, but in some weird way, that only the file conversion process is illuminating?

If no one else knows why this might have happened, just by virtue of having more experience with PDFs, then you could upload your SVG file, right into your next reply, as an attachment. We could look and see what's happening. (I'm thinking hidden layers or path operations, or maybe even using a clip....? Just can't tell without more info.) But just upload that one image or page; don't think we need the whole book :mrgreen:

Oh hey, I meant to mention this in my last reply, but forgot. For SVG to PNG, you need to use File menu > Export Bitmap, not Cairo PNG. If you used that cairo png thing, THAT might explain the whole thing.

Missy
Posts: 12
Joined: Fri Apr 09, 2010 9:49 am

Re: Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby Missy » Tue May 11, 2010 8:38 am

Hi Brynn,

Yes, I have been exporting the images thru Export Bitmap vs. Cairo PNG. Thank you for offering that I upload the image, however, that won't be necessary now because the customer service guy at Lulu suggested the same thing today. And guess what? I uploaded the following image path: SVG > PNG> PDF (error notice and all) and it's perfect he said! So, now I can proceed forward with my project as an eBook!

You had suggested earlier that I look on Wiki for differences on file formats and I did. Interestingly enough, here is what it said about JPEG:

“On the other hand, JPEG is not as well suited for line drawings and other textual or iconic graphics, where the sharp contrasts between adjacent pixels cause noticeable artifacts. Such images are better saved in a lossless graphics format such as TIFF, GIF, PNG, or a raw image format. JPEG is also not well suited to files that will undergo multiple edits, as some image quality will usually be lost each time the image is decompressed and recompressed, particularly if the image is cropped or shifted, or if encoding parameters are changed – see digital generation loss for details. To avoid this, an image that is being modified or may be modified in the future can be saved in a lossless format such as PNG, and a copy exported as JPEG for distribution.”

Thank you again and I may have more questions for you!

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Converting to PDF & Transparency Issue (Need Answer ASAP!)

Postby brynn » Wed May 12, 2010 9:37 am

....JPEG is also not well suited to files that will undergo multiple edits, as some image quality will usually be lost each time the image is decompressed and recompressed....

Aha! Well there you go :mrgreen:

Thank you again and I may have more questions for you!

You're welcome. That's why we're here :D


Return to “Help with using Inkscape”