| <<<Back 1 day (to 2017/10/26) | 20171027 |
aleray | hi, I found this page: https://stackoverflow.com/questions/35596346/ghostscript-convert-pdf-into-cmyk-preserving-pure-black-for-text#35646895 | 12:10.42 |
| I'm interested to convert rgb pdfs to cmyk | 12:11.00 |
| I want to preserve pure black | 12:11.09 |
| if I understand correctly, they treat different kind of object with different icc profiles | 12:12.14 |
kens | The pdfwrite device doesn't do that, no. | 12:12.30 |
aleray | kens, so what about this stackoverflow answer? what does it do exactly | 12:13.53 |
| no sure to understand what it achieves | 12:14.03 |
kens | I have no idea, as far as I can tell, it does nothing | 12:14.10 |
| Well, more accurately, the Ghostscript part runs a PDF file and produces a PDF file, it set teh ColorConversionStrategy to CMYK, so any objects which are in RGB or 'special' colour spaces will be converted to CMYK. We leave Gray objects untouched. | 12:15.39 |
| Very possibly the person who write the answer *thought* that the rendeing control 'SourceObjectICC' was doing something, but they are mistaken | 12:17.38 |
tsr2 | I have a PDF file that seems to kill ghostcript versions > 9.15. | 13:16.53 |
kens | Then I suggest you open a bug report | 13:17.08 |
tsr2 | If I use a debg build it throws a GCUnrecoverable error otherwise it loops. | 13:17.37 |
| As it's got potentially confidential data I want to be cautious about putting it in a bug report. | 13:18.20 |
kens | Is the file a sensible size ? | 13:18.41 |
tsr2 | If there is anything that I can do to narrow down the issue myself I woudl be interested in doing so. | 13:18.58 |
| If there is anything that I can do to narrow down the issue myself I would be interested in doing so. | 13:19.04 |
kens | Are you a skilled PostScript programmer ? | 13:19.16 |
tsr2 | file size is < 100kB | 13:19.45 |
| I am not a Postscript programmer. | 13:19.57 |
kens | Then frankly you dont have a hope of debugging it | 13:20.11 |
| I'd suggest you open a bug report and email the file to me | 13:20.26 |
tsr2 | fair enough | 13:20.27 |
kens | ken.sharp at artifex dot com | 13:20.40 |
tsr2 | thank you | 13:20.56 |
kens | I can attach it and mark it private so that only Artifex staff can see it | 13:20.58 |
aleray | kens, thanks | 13:27.01 |
kens | Well, I can't say I was entirely helpful.... | 13:27.18 |
| But FWIW you're welcome | 13:27.24 |
aleray | More specifically, I'm interested to leave black text (r:0 b:0 g:0) black (c:0 m:0 y:0 b:100). | 13:28.03 |
| I guess this is were it becomes problematic non? | 13:28.24 |
kens | If you set up the input and output ICC profiles appropriately that should be possible, I think | 13:28.24 |
| But the pdfwrite device takes no account of object types, it simply passes them through the ICC CMS | 13:28.45 |
tsr2 | Ken, I've sent you an email. I am just registering in bugzilla for the bug report. | 13:34.07 |
kens | RIght let me cvheck my mail | 13:34.15 |
| OK go it | 13:34.25 |
| got* | 13:34.31 |
| Yeha this doesn't look confidential (I do speak German) but all the same I'll attach it as private | 13:35.20 |
| Doppler for beginners :-) | 13:35.45 |
| Oh its a vetirnary seminar | 13:36.10 |
| tsr2 well a quick run of the file to pdfwrite works for me with current code.... I'll try 9.21 | 13:39.43 |
| 9.21 release version 32 and 64 bit works as well | 13:40.41 |
| 9.16 works 32 and 64-bit as well. Guess I'm going to need more information | 13:43.02 |
| Oh you are running to *PostScript*, not PDF | 13:44.56 |
| I'd guess the change was when we modified the pdftops shell script to use ps2weite instead of pswrite | 13:45.37 |
aleray | kens, I'm a little bit lost; maybe I should just reexplain what is my goal and let you propose a solution for that? I create rgb pdfs using a web browser. Thoses pdf need to be printed in offset. I'd like the color images to be converted into cmyk, the grayscale images to stay grascale and the black text to be pure black. Is there a way to achieve this using ghostrcipt or other means? | 13:50.08 |
tsr2 | Ken. Are you seeing the issue now, with pdftops? | 13:50.53 |
kens | Probably yes, but I'm not the colour expert. If you set up the input ICC profile (RGB) and the output ICC profile (CMYK) correctly then I believe it should be possible to have R=G=B map to CMY=0 K = R/G/B | 13:51.25 |
| tsr2 I'm using the ps2write device | 13:51.34 |
| And yes | 13:51.39 |
| Its unable to add a long Unicode string representing a filespec to a dictionary | 13:51.57 |
tsr2 | It's always nice when you can reproduce it | 13:53.54 |
kens | Well it certainly helps to fix it :-) | 13:54.05 |
| I'm probably going to have to set this aside though, I'm in the middle of 2 other jobs already | 13:54.19 |
tsr2 | sure, I don't expect instant fixes when reporting issues to people I;m not paying ;-) | 13:55.30 |
| sure, I don't expect instant fixes when reporting issues to people I'm not paying ;-) | 13:55.37 |
| my last KDE bug report took 3 years to fix, IIRC | 13:56.50 |
kens | O.O | 13:56.54 |
| Well we aren't 'usually' that bad | 13:57.02 |
| I had hoped that disabling annotations would be a work-around for you, but it seems not | 13:57.32 |
| One thing to note; the PDF file contains transparency, so at least some pages will end up as large images, no vector content | 13:58.02 |
| Its definitely an annotation. One with an action | 13:59.36 |
| Ah, we're trying to find a place to split the string, because its more than 256 bytes, and for some reason we can't. | 14:01.19 |
| tsr2 I can sort of see the problem, shouldn't be hard to fix, but like I say I have to finish the stuff I'm doing right now. You'll get an email when the bug status changes. | 14:03.57 |
tsr2 | thanks Ken. Much appreciated. | 14:04.22 |
kens | NP | 14:04.30 |
aleray | kens, thqnks for your help | 14:14.56 |
kens | NP | 14:15.16 |
aleray | probably come back later after I processed the info I have now | 14:15.35 |
kens | Our colour expert should be online 'soon' (west coast US) and may be able to say something more helpful | 14:15.44 |
aleray | what is his name? | 14:15.55 |
kens | He'll be online as mvrhel_laptop probably | 14:16.12 |
aleray | thanks kens | 14:27.45 |
| hello mvrhel_laptop | 14:27.55 |
| I asked a question about color conversion a little bit earlier. Kens advised to ask to you | 14:28.21 |
| here was the question | 14:28.28 |
| kens, I'm a little bit lost; maybe I should just reexplain what is my goal and let you propose a solution for that? I create rgb pdfs using a web browser. Thoses pdf need to be printed in offset. I'd like the color images to be converted into cmyk, the grayscale images to stay grascale and the black text to be pure black. Is there a way to achieve this using ghostrcipt or other means? | 14:28.31 |
kens | NB this is for *pdfwrite*, not rendering | 14:28.52 |
aleray | I found some clues there https://stackoverflow.com/questions/35596346/ghostscript-convert-pdf-into-cmyk-preserving-pure-black-for-text#35646895 | 14:29.27 |
mvrhel_laptop | if you are talking about pdfwrite, I will leave you to kens..... | 14:31.43 |
kens | LOL | 14:31.49 |
| pdfwrite is simple in this regard | 14:31.56 |
| It does nothaing for object types | 14:32.02 |
| Whatever teh CMS does for RGB->CMYK conversion is all it can deal with | 14:32.19 |
| If you can arrange a conversion where R=G=B -> C==M=Y=0 and K = RGB then it will work | 14:32.44 |
| I would have thought that was possible with careful selection of ICC profiles, but..... | 14:33.05 |
| Not my field | 14:33.08 |
mvrhel_laptop | kens: question for pdfwrite. does it pay attention to the object dependent icc profiles in doing its color conversions? | 14:34.50 |
kens | No | 14:34.56 |
| Everything goes through the 'default' conversion path | 14:35.23 |
mvrhel_laptop | hmm. I should probably do a little testing with this | 14:35.43 |
kens | IIRC this is somethign we've talked about before, but its never been worked on | 14:36.02 |
aleray | fyi this is what we use for now: https://gitlab.com/medor/rgb2cmyk/blob/master/bin/rgb2cmyk.sh | 14:38.50 |
| looking for a cleaner solution | 14:38.56 |
kens | Using PDftops is a really bad idea | 14:40.14 |
aleray | because of the pdf -> ps -> pdf conversion? | 14:41.05 |
kens | Yes | 14:41.09 |
| Lots of potential for losing fidelity, not least if the original PDF has any transparency | 14:41.32 |
aleray | this is why I'm around :) yes we have issues with transparency | 14:41.54 |
mvrhel_laptop | I have to grab some breakfast and take care of a couple other things here. I will take a quick look later to see if the cmm workflow with pdfwrite makes use of the object dependent color management stuff. I actually suspect it does | 14:48.10 |
kens | I'm not sure how, I don;t recall anythign being passed by pdfwrite to tell the CMS what object type is beign processed | 14:48.45 |
mvrhel_laptop | In that case you can control to what ever level you need but you will have to design the ICC profile to do it | 14:48.48 |
| kens: the information is in dev->graphics_type_tag | 14:52.22 |
kens | Hmm I didn't realise I set that | 14:52.33 |
mvrhel_laptop | so when you request a link, it should hand you back the correct one | 14:52.38 |
| That is the question then | 14:52.50 |
| If it is getting set, you will get back a link using the special profile | 14:53.02 |
kens | It *may* be set by the interpreter, I'm not certain | 14:53.03 |
mvrhel_laptop | I think gs_fill is doing it | 14:53.21 |
| iirc | 14:53.24 |
chrisl | The graphics library sets the tag type | 14:53.53 |
kens | Oh then it probably does work | 14:54.06 |
mvrhel_laptop | ah ok | 14:54.12 |
| the man with the answers | 14:54.16 |
| so there, it should all work | 14:54.23 |
chrisl | Assuming that pdfwrite doesn't have it's own set_tag method, that does something "odd" | 14:55.47 |
mvrhel_laptop | so aleray needs to read the icc white paper | 14:55.49 |
kens | I don't think pdfwrite does anything with tha | 14:56.01 |
chrisl | I can't imagine why it would use anything other than the default | 14:56.31 |
mvrhel_laptop | aleray: So I would suggest you look this over | 14:57.57 |
| https://www.ghostscript.com/doc/9.22/GS9_Color_Management.pdf | 14:58.08 |
| especially the first part on usuage | 14:58.45 |
| You should be able to achieve your goals with that | 14:59.06 |
aleray | mvrhel_laptop, thanks | 15:06.02 |
| I will start with that | 15:06.13 |
mvrhel_laptop | aleray: If you have issues come back and ask | 15:08.23 |
aleray | ok! | 15:18.52 |
| Forward 1 day (to 2017/10/28)>>> | |