xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fotis Jannidis" <fotis.janni...@lrz.uni-muenchen.de>
Subject RE: Scaling of images
Date Thu, 14 Dec 2000 14:02:12 GMT
From:           	Eric SCHAEFFER <ESCHAEFFER@Techmetrix.net>

> I'm not sure to understand.
> Can't we know the dpi of the document ?

Maybe I am misunderstand your question, but here is my answer to 
what I understood: 

do we need dpi in our calculation here or can't it be calculated at the 
end (see the document I copied to the end of this message)? what 
we need is the 'real' size of the image. The image format either 
stores the real size or some kind of density information information 
which can be used to restore the real size. 

If the image file doesn't store the real size, you must assume some 
conversion factor to get your 'real' size. Here the recommendation 
says 1/96", so a image with 800/600 pixel is converted to 8,33" * 
6,25" (and now you can calculate dpi)

Having either calculated or retrieved the image size, we can go on 
with getting the ratio and then scaling etc. 

> Also another thing: if only one size is writen in the FO file (width or
> height), we should keep the aspect ratio, no ?

yes, we should. Use the given size and calculate with the real size 
the scale factor and apply this to the not given size: "If one of the 
content-height or content-width is not "auto", the same scale factor 
(as calculated from the specified non-auto value) is applied equally 
to both directions." 

> Eric.
> Consultant TechMetrix Research
> http://www.techmetrix.net
> Groupe SQLi
> http://www.sqli.com
> Créateurs de sites intelligents depuis 1995
> > -----Message d'origine-----
> > De: Fotis Jannidis [mailto:fotis.jannidis@lrz.uni-muenchen.de]
> > Date: mercredi 13 décembre 2000 17:40
> > À: fop-dev@xml.apache.org
> > Objet: RE: Scaling of images
> > 
> > 
> > A while ago we discussed scaling of images on the list. Our problem 
> > was: what is the conversion between pixels and document units? 
> > 
> > Now Anders Berglund from the xsl:fo working group clarified this: 
> > 
> > >>>>>>>>>>>
> > I thought the XSL CR (and the text has not
> > changed for several WDs) text was clear that IF a graphics 
> > format (like
> > JPEG and TIF) has an intrinsic size that it was used for the 
> > graphic (as
> > modified by the various scaling properties) and that IF a 
> > graphics format
> > (like GIF) did not have an intrinsic size defined the 
> > conversion to "real"
> > units was implementation defined BUT (in a Note) it is 
> > suggested that for
> > raster formats 1/96" for 1 pixel is a reasonable conversion.
> > <<<<<<<<<<
> > 
> > This means, we don't have to invent a factor (what I mistakingly 
> > thought), but there is a recommendation in the recommendation. 
> > Handling of image size would look like this: Check whether the 
> > image is in a file format which has intrinsic size 
> > definition. If yes, 
> > use this, if no, take the pixel size (* 1/96")
> > 
> > Fotis
> > 
> > 

          Nuggets: Comparing Pixels and Dots-per-Inch         

          Walker, Imaging Field Services Officer, Amigos Imaging &
          Preservation Services         
          I've been looking at digital cameras and noticed that specifications
          for resolution are given in pixels rather than dots per inch. Why is
          this, and how can the pixel dimensions be compared to dots per inch?         
          flatbed scanners, which have a fixed resolution regardless of the size 
          of the document being scanned, digital cameras  and slide scanners
          as well  have a fixed pixel array, meaning the resolution as
          expressed in dots per inch (dpi) will depend on the size of the
          original (that is, how far the camera must be placed from the
          order to convert the resolution to dpi, you need to determine how the pixels 
          will be spread out along the length and width of the document.
          To do this, simply divide the shorter dimension of the pixel array by
          the shorter dimensions of the document, and the longer dimension of
          the pixel array by the longer dimension of the document. Because the
          aspect ratio  the ratio of length to width  of the original
          document will rarely match the aspect of the pixel array of the
          digital camera, the smaller of the two numbers will be the resolution
          of the digital camera on all documents with those measurements.         
          example, a high-quality digital camera might have a pixel array of
          5000 by 7000. Using this camera to scan an 11" x 17' document and
          dividing the dimensions of the pixel array by the dimensions of the
          document results in 455 dpi (5000 pixels or dots divided by 11 inches
          equals 454.5 dots per inch) and 412 dpi (7000 pixels or dots divided
          by 17 inches equals 411.8 dots per inch). Taking the smaller of the
          two numbers, we can expect a resolution of 412 dpi (not a resolution
          of 455 in one direction and 412 in the other).         
          the same camera to scan a larger document will result in lower resolution images
(a 24" x 36" document would be around 200
          dpi), while a smaller document could be scanned at much higher
          resolutions (an 8.5" x 11" document would have a resolution
          around 600 dpi).         
          transparency and microfilm scanners usually specify resolution in a pixel array
as well. 
          In this case, resolution needs to be determined
          by the original documents rather than the image size as it appears on
          the 35mm slide or 4" x 5" transparency. A common pixel array
          for slide scanners is 2000 x 3000. If scanning the slide of a 5"x
          7" photograph, the same formula is used to determine the
          resolution in dpi: 2000 pixels divided by five inches equals 400 dpi;
          3000 pixels divided by seven inches equals 429 dpi. We can expect a
          400-dpi resolution. From the slide of a 24" x 36" map, we
          could expect a resolution of 83 dpi.         
          digital cameras and slide scanners have the capability of scanning oversize 
          items that would be impossible to fit on a flatbed scanner,
          it should be recognized that there are limitations to the quality of
          image capture, and these devices may not prove adequate for imaging
          all oversized materials. ###         

View raw message