aginiewicz / createspace

LaTeX package for typesetting books ready for CreateSpace.com
http://wiki.github.com/aginiewicz/createspace
76 stars 9 forks source link

transparent pngs printing as black #5

Closed Erreinion closed 8 years ago

Erreinion commented 8 years ago

Reproduced with the following code:

\documentclass[11pt]{book}
\usepackage[size=novel,bleed]{createspace}  
\usepackage{graphicx}
\DeclareGraphicsExtensions{.png,.jpg}

\begin{document}
\includegraphics[scale=0.5]{sample}
\end{document}

The colour portions of the png print fine, but the transparent layer prints as black. Problem goes away when the createspace package is commented out.

aginiewicz commented 8 years ago

I think this is because transparent pngs are not allowed in PDF/X-1a iirc, so when setting the requirement to output file that validates, it can behave in unexpected ways. You have to use png without alpha - or if you want to use transparent background (0-1 transparency) switch to vector graphics, especially TIkZ. There is application svg2tikz (https://github.com/kjellmf/svg2tikz) that I used to convert SVG files (for example from Inkscape) to TikZ with great success. What exactly you need transparency for?

Erreinion commented 8 years ago

Thank you for the explanation. The images I was given have transparent layers. Converting to jpg lowers the quality, so I was hoping to get the pngs to work. I will work on different conversion options.