General XMetaL Discussion
robsfl February 24, 2009 at 9:29 am
How to set consistent image DPIFebruary 24, 2009 at 9:29 amParticipants 3Replies 4Last Activity 13 years, 4 months ago
The situation: many images with varying sizes that should be inserted with a consistent DPI. We need to avoid the scaling attribute to be consistent with DITA 1.0.
Sizing images is quite difficult. In FrameMaker we just assigned a fixed DPI value and that was all. In Xmetal this is evidently not possible? Is the only was to calculate the size in px with a calculator and to enter this manually? Xmetal will not even calculate the width/hight ratio, so I have to always enter both values.
This seems quite awfull, but as I am new I am probably overlooking something. Any help or ideas would be greatly welcomed!Derek Read February 24, 2009 at 10:03 pm
Reply to: How to set consistent image DPIFebruary 24, 2009 at 10:03 pm
I think this question really needs to be framed within a particular output format. As most people concerned with image quality etc are going to PDF I might assume that here. I also assume we are talking about bitmaps as well (such as JPG, GIF, TIF…)
1. Figure out the best (or lowest) quality of image you are willing to embed in the PDF and standardize on that (the DPI for this will be dictated to the people that make your images). The higher the quality (the more pixels it contains) the larger the file size, which translates directly into making your PDFs bigger. Assuming you do not need to allow readers of the PDF to zoom in and see more detail the ideal size would be 1:1, though this does get tricky because there is not really a 1:1 correspondence between bitmaps and what appears in the PDF which is typically translated to real-world units using various conversions (there are settings in PDF viewers that let people override these things). When viewed on a screen, an image created for viewing in Windows (typically at 96 DPI) will appear different on a Mac (typically 72 DPI) AND if the reader has altered the settings in their PDF viewer. In Acrobat 8 look in Preferences for Page Display > Resolution > Use System Setting (value obtained from the OS) or Custom Setting (you can set any value you like here to mess with things). If I could spare the room (making the PDF larger) I would probably recommend images of 150 DPI and then scale them down to fit the area I need on the page, (perhaps by roughly 75% so they roughly match 96 DPI for most readers). This will allow people to zoom in to see details (if necessary) and will also give a reasonable print output in many cases if people do decide to print a physical copy.
2. If you wish to avoid the use of the scale attribute (which is not really supported by the DITA OT yet anyway, regardless of whether you are using DITA 1.0 or 1.1) set only one of the dimensions of the image. Both XMetaL Author Enterprise and the DITA OT currently support setting both width and height or one of either. If you set only one the other one will automatically size using the correct aspect ratio. This follows the rules laid out in the DITA Language Reference. XMetaL Author Enterprise itself handles width, height and scale properly, along with the various allowed units. The limiting factor here at the present time is the DITA OT.
Scaling and Units:
If you know the maximum width for your PDF content (within margins) is 6.5 inches (for example) then use “6.5in” as the maximum width for your images. This is the one main reason I can think of to scale down if necessary (when an image is too big to fit within the area it is contained inside in a PDF it will not be visible). Or if you prefer to deal with centimeters or millimeters (perhaps you are using A4 or other European paper sizes) then use those units instead (cm and mm).
If you do not wish to change the size of the images at all but instead leave your images at “100%” then simply specify nothing for scale, height or width. In this case both XMetaL Author Enterprise and the DITA OT will honour that and figure out how big an image should be (translation is done by RenderX using 120 DPI default but this may also be 96 or other depending on the output customization). Again, this follows the rules laid out in the DITA Language Reference.
All of this may vary for other output types. It will also vary if you are using a modified copy of the DITA OT.
Conditions (aka: Conditional Text):
Another slightly more complicated option would be to create two or more images at different resolutions and use conditions to specify which one will be included when generating a particular output. This would allow you to create a “high resolution PDF” (containing images at high resolution but scaled down) and a “regular” or “low” resolution PDF (containing images at lower res). Conditions may also be useful when using the same content to generate HTML or other output formats where you wish to use quite different settings with regard to images.robsfl February 25, 2009 at 8:40 am
Reply to: How to set consistent image DPIFebruary 25, 2009 at 8:40 am
thanks for the great explanation. Yes indeed the image handling is related to the print output (PDF). Actually we have two types of images:
* Screenshot with varying sizes
These were previously inserted with a fixed DPI (180) in order to keep the size of the input fields and text consistent.
* Figures with a fixed consistent width and only varying height
Your tip to enter only a width works well here, I enter e.g. 420 px (depending on the print layout) and let Xmetal determine the height. I was only confused here because if both values are already set and I change one, then the other stays as it is. But on first insertion I enter the width only and all is fine.
I will look further into the handling of the screenshots based on your ideas. I do not fully understand the relation yet – images (e.g. a JPG) have no DPI information, only a size in px. Its the publishing program that determines the size in inches/cm from this size, based on a DPI value. So somewhere there must be a default DPI setting that determines just exactly HOW large in inches/cm a “100%-setting” is output in the PDF. If I find a sloution I will post.Derek Read February 25, 2009 at 7:20 pm
Reply to: How to set consistent image DPIFebruary 25, 2009 at 7:20 pm
images (e.g. a JPG) have no DPI information, only a size in px. Its the publishing program that determines the size in inches/cm from this size, based on a DPI value. So somewhere there must be a default DPI setting that determines just exactly HOW large in inches/cm a “100%-setting” is output in the PDF.
If you are using the deliverable “XMetaL Enhanced PDF via RenderX XEP” the file that controls this is located here (on a default installation of English Windows XP):
C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomizationfoxslxm_image_size_fix.xsl
That file assumes a DPI setting of 96 is a good thing because it will then match what people see while editing in XMetaL Author (unless they've messed with their Windows display settings and changed them from the default value of 96). Without this the standard DITA OT setting is 72 which is more common on Macs (where our software does not run). You will see that if you are using the deliverable we call “Book via RenderX”, known as the “PDF2 transtype” in the DITA OT world.robsfl February 26, 2009 at 7:57 am
Reply to: How to set consistent image DPIFebruary 26, 2009 at 7:57 am
Derek, that is a good hint thanks. Previously I was using the Dita OT seperately, but I will fiddle with this a bit. I am also considering using three fixed image widths in px for screenshots (small/middle/fullscreen) and just settle on these. The Images will not have the exact same scaling, but maybe well enough. Life´s a compromise.
- You must be logged in to reply to this topic.