Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2020/09/06)Fwd 1 day (to 2020/09/08) >>>20200907 
myopia if I know before hand an image features a dimension of X and Y, for width and height respectively, how could I manipulate the XObject Image dictionary object so that the DPI/PPI (I assume DPI == PPI here) gets defined?03:07.46 
  also, in case I got it wrong, pdf17 defines the Named Object /Width as "The width of the image, in samples." I assume "samples" here means pixels/dots?03:10.34 
  or rather, does it have something to with the Page object (which contains only this image)03:15.05 
  ?03:15.13 
ator myopia: no, there's no relation to the DPI or number of samples and the size of an image as drawn on the page08:29.14 
  myopia: all images drawn in PDF are a square 1x1 points large, which can be rotated, scaled and translated by the transform matrix to place it anywhere at any size08:30.19 
myopia ator: so PDF is not responsible for setting DPI/PPI?08:30.46 
ator nope. it has no concept of image DPI at all.08:30.57 
  you assume correct in that "samples" means pixels08:32.01 
myopia ok. so I am responsible for finding the true width/height of an image after getting number of pixels per width/height and reduce it through the {x,y}resolution in the metadata then... but then, doesn't this make width/height a floating point number?08:32.56 
ator the true width and height for any given image resource in PDF can vary, depending on how and where it is used on the page08:33.58 
  the same image resource can be drawn multiple times, at different sizes08:34.08 
  you have to look at the transform matrix (as set by the "cm" operator) in use at the time the "Do" operator is used to draw the image to get the displayed size in points (and factor in rotation and skewing components of the transform as well)08:35.56 
  I suggest giving chapter 4.8 Images in PDF reference 1.7 a quick read08:37.06 
myopia well, since it does say "in samples" for both width and height, I suppose it has to be an integer. otherwise, we would be getting weirdness after "3.456 pixels" and yeah, using a transform matrix would avoid me filling the width/height field by hand08:37.21 
ator 4.8.3 Image Coordinate System08:37.30 
  the Width and Height is an integer number of pixels/samples in the image data08:37.56 
myopia oh, I skimmed 4.8.3 last time. looks like we are getting a homogeneous coordinates here even :)08:38.28 
ator if you have a JPEG image that is 300x300 pixels, and you want to draw it as a 2 inch x 1 inch rectangle, the PDF file would have: a) an image resource object with << /Width 300 /Height 300 /Filter DCTDecode >> stream ...JPEG data... endstream endobj08:38.59 
  then in the page object it would have a /Resources << /XObject ... 99 0 R >> entry08:39.33 
  and in the content stream it would draw the image with these operators:08:39.44 
  144 0 0 72 100 100 cm /Image1 Do08:40.08 
  the 144 scales the unit rectangle to 144 points (2 inches) wide08:40.36 
  so the DPI would be 150 x 300 (asymmetric X and Y resolutions) for that particular drawing of the image08:41.16 
  now, the JPEG image may have a resolution App marker in the data, and that's completely ignored by PDF08:42.01 
myopia that's a very clear elucidation, ator. with no intent of irony, I think you could probably find a college thats offer you a teaching position for computer graphics and PDF08:44.02 
ator I'm just happy to help out :)08:45.07 
myopia I got the docs, yes, but I wouldn't know how to put two and two together without your linking them up08:45.07 
  and I08:45.30 
  am glad that proper geometricians still have a place in this world08:45.47 
 <<<Back 1 day (to 2020/09/06)Forward 1 day (to 2020/09/08)>>> 
ghostscript.com #mupdf
Search: