From: "Charles C. Kankelborg" Date: 2008 July 15, 10:44:22 AM MDT To: sg@solar.physics.montana.edu Cc: Craig DeForest , Moses local , "Joseph A. Dellinger" Subject: [Moses_local] PDF breaks my images! Dear friends, I thought you might find this tale of woe useful and informative. Best of all, I have a solution to share. THE PROBLEM When writing a journal article, we generally have to put our images in Postscript format (.ps or .eps). I've found that the images in my latest paper pick up JPEG-like artifacts when the paper is converted to PDF (for example, with dvipdfm). If you are trying to show the difference between a noisy image and a not-so-noisy one (as I am), the compression artifacts can completely obscure the difference. WHY IT HAPPENS (If you are in a hurry, skip to SOLUTION 2) The ghostscript distiller (like most) uses lossy DCT encoding of the images. The default settings are very low quality. I could be wrong, but I think that an MS Word document with EPS figures would pick up the same artifacts when it is run through Adobe's Distiller. SOLUTION 1: DISTILLER SETTINGS (NOT ENTIRELY SATISFACTORY) I can work around the problem by controlling my own PDF conversion (e.g., use dvipdfmx, which uses higher quality encoding by default), but here is the kicker: The PDFs made by the journal and my ArXiV preprint will probably still have the artifacts because *their* PDF is distilled by whatever process *they* use. SOLUTION 2: MODIFY THE POSTSCRIPT (THE "SILVER BULLET"!) Here is a magic incantation which, if placed in your .eps figures (after the "%" comments), will instruct any Adobe-compliant PDF generator to use lossless FlateEncode instead of lossy DCTEncode: systemdict /setdistillerparams known { << /AutoFilterColorImages false /ColorImageFilter /FlateEncode >> setdistillerparams } if Do not fear editing postscript files with your text editor. It is fun, and this particular fix is easy. I've already tried this "silver bullet" with ArXiV, and it works! REFERENCES I learned all of this from: http://electron.mit.edu/~gsteele/pdf/ ________________________________________________________________________ Charles Kankelborg AC7NY | 260C EPS Building | "Truth and falsehood are opposed; but truth Physics Department | is the norm not of truth only but of Montana State University | falsehood also." Bozeman, MT 59717 | Phone: 406-994-7853 | --C. S. Lewis, The Allegory of Love FAX: 406-994-4452 | http://solar.physics.montana.edu/kankel/ _______________________________________________ Moses_local mailing list Moses_local@ssel.montana.edu http://io.ssel.montana.edu/mailman/listinfo/moses_local Archive: http://io.ssel.montana.edu/mailman/private/moses_local/