Export Resolution Draft2

From Apache OpenOffice Wiki
Revision as of 10:29, 3 April 2008 by Saperski (Talk | contribs)

Jump to: navigation, search

Setting Pixel Resolution when Exporting Graphics

Specification Status
Author Regina Henschel
Last Change
Status (Help) Preliminary

Abstract

This specification describes an User Interface to determine the amount of pixels which are used, when exporting a graphic from Draw or Impress to a raster format like BMP oder PNG. The corresponding enhancement request has 45 votes and several duplicates.

References

Reference Document Check Location (URL)
Prerequisites [passed/failed] n/a
Product Requirement, RFE, Issue ID (required) [available] Issue 4499
Test case specification (required) [available/not available] <PLEASE ENTER LOCATION HERE>
IDL Specification [available/not available] <PLEASE ENTER LOCATION HERE>
Software Specification Rules n/a n/a
Other, e.g. references to related specs, Product Concept Document <PLEASE ENTER LOCATION HERE>

Contacts

Role Name E-Mail Address
Developer <First Name, Last Name> <User@openoffice.org>
Quality Assurance <First Name, Last Name> <User@openoffice.org>
Documentation <First Name, Last Name> <User@openoffice.org>
User Experience <First Name, Last Name> <User@openoffice.org>

Acronyms and Abbreviations

Acronym / Abbreviation Definition
<WYSIWYG> <What You See Is What You Get>

Detailed Specification

Current Situation in OOo2.4

OpenOffice.org can export the vector format drawings to a raster format. The amount of pixels are calculated from the screen resolution of the operating system, the view scale setting in Tools > Options and the width and height of the object. For example: An object with 1.0 x 0.5 inches, with a Windows XP screen resolution of "120DPI" and an OOo view scaling of 125% gives on export to BMP a size of 151 x 76 Pixels. This is approximately the calculation 1.0 inches ⋅ 120DPI ⋅ 125% = 150 dots. During export there is a list to determine "DPI", but that does not change the amount of pixels but only sets an meta information. There exists already some code to set pixel resolution. But this can only be used with a macro. The current export dialog uses a lot of dialogs, depending on the kind of target format.

  • EMF, MET, PICT, SVM, WMF

ExportOOo2draw2emf.png ExportOOo2draw2met.png ExportOOo2draw2pict.png ExportOOo2draw2svm.png ExportOOo2draw2wmf.png

  • PBM, PPM

ExportOOo2draw2pbm.png ExportOOo2draw2ppm.png

  • BMP

ExportOOo2draw2bmp.png

  • EPS

ExportOOo2draw2eps.png

  • GIF

ExportOOo2draw2gif.png

  • JPEG

ExportOOo2draw2jpeg.png

  • PDF

ExportOOo2draw2pdf.png

  • PNG

ExportOOo2draw2png.png

  • Without any dialog are RAS, SVG, SWF, TIFF
  • Export to HTML uses a wizard.

Competitor's Solutions

Corel Draw 12

Corel Draw 12 uses one dialog for all kind of target raster formats. Elements which do not apply to the specified format are greyed out. Settings which are only necessary for a specific format are set in a following dialog. In addition to the pixel resolution the user can set the color depth. Examples:

  • Standard Bitmap Dialog

common dialog for export to a raster graphic format

  • Special Options Dialogs

ExportCorel2pngoptions.png ExportCorel2jpegoptions.png

New Behavior in OpenOffice.org

OpenOffice.org uses a unified dialog, which appears after the user has chosen the export file format. The lower section of the dialog depends on the export format. All settings are persistent during one OOo session.

There is no restriction to the settings but the available space in RAM and on disk.

The new dialog applies to all export formats but HTML, XHTML, PDF, SWF and PWP.

ExportNewRasterGraphicOptions.png

The values don't fit together but only show the design of the dialog.

The upper part is common to all formats. If a setting or value makes no sense for the chosen format, then it is disabled or hidden.

The drop-down list for the unit of measurement offers the items

Pixels
Millimeter
Centimeter
Meter
Inch
Foot
Pica
Point

The length values refer to the "drawing" size, not to the "real" size. Example: The user sets "Meter" as unit of measurement for Draw in Tools > Options > General and sets the "drawing scale" to "1:10" there. If a dimension line shows 0,65m or a square has size 0,65 x 0,65 in the status bar, then the drawing size is 6,5 cm. And this size of 6,5cm will be used in the export dialog as "original size".

"Pixels" is the decisive value. The other values are calculated from the pixels width and height according to the actual setting in "Resolution". The pixel width and height is rounded up to an integer after each changing.

The user can enter decimals for all length values. Decimals are kept with the entered or calculated precision, but only shown with maximal 3 decimal places.

The drop-down list for the pixel resolution unit has the items

pixel/cm
pixel/inch

The resolution value field contains positive integers. If the resolution value is changed, the amount of pixels is recalculated with 'new resolution value' / 'old resolution value' * 'old pixel value'. The length values of width and height are recalculated afterwards.

The value of pixel/inch is written to the meta data of the graphic, if the format allows such setting.

If keep ratio is checked, when height or width is changed, the other one is calculated automatically. 'keep ratio' does not refer to the original size but to the previous values in the dialog.

The button original size sets the height and width to that of the selection or page which is to be exported.

The color depth is a drop-down list with items

1 Bit Threshold
1 Bit Dithered
4 Bit Grayscales
4 Bit Color Palette
8 Bit Grayscales
8 Bit Color Palette
24 Bit True Color

Changing the color depth effects "size in memory" and "round file size" but not the pixel dimensions.

The text in the part memory changes accordingly to the chosen object size, resolution and color depth. Both values are not guaranteed to be exact.

The lower part contains settings, which are specific to the format. The current settings should be possible, but I suggest some additions.

BMP

ExportToBMPSpecialSettings.png

RLE compression reflects back to memory size texts.

All color depths are available but '24 Bit Grayscales'. Why is 24 Bit Grayscales not implemented for BMP export?

EMF

No special settings needed.

Hide color depth and pixel dimension? What to do if the selection or page which is to be exported contains bitmaps?

EPS

ExportToEPSSpecialSettings.png

Compression and preview settings reflect back to memory size texts.

What further settings are used for the preview image? Are the user allowed to change them?

GIF

ExportToGIFSpecialSettings.png

Color depth list shows the currently used setting, other values are disabled.

It should be possible to set the color depth.

JPEG

ExportToJPGSpecialSettings.png

The compression reflects back to the memory size texts.

The color depth list shows the values '24 Bit Color' and '8 Bit Grayscales', which substitute the current radio buttons. Other values are hidden. The Grayscales export has a bug currently. It uses gray colors in a RGB color space. Although gray, the picture is still of kind 24bpp. see Issue 87410

MET

No special settings needed.

The color depth list shows the currently used setting, other values are disabled.

PBM

ExportToPBGPMSpecialSettings.png

The file format reflects back to the memory size texts.

The color depth list shows '1 Bit Treshold', other values are disabled. That is the color depth used in PBM format.

PGM

ExportToPBGPMSpecialSettings.png

PBM need to be exchanged wtih PGM.

The file format reflects back to the memory size texts.

The color depth list shows '8 Bit Grayscaled', other values are disabled. That is the color depth used in PGM format.

PICT

No special settings needed.

Color depth list shows the currently used setting, other values are disabled. PICT allows many settings, but currently the user cannot select any of them.

PNG

ExportToPNGSpecialSettings.png

The compression reflects back to the memory size texts.

The color depth shows the currently used setting. The user should be allowed to set the color depth. It is already possible for embedded png-pictures. So why not implement it for export? The code is already there.

PPM

ExportToPBGPMSpecialSettings.png

Replace PBM with PPM.

The file type reflects back to the memory size texts.

The color depth shows the currently used setting.

RAS

Currently no export dialog exists.

The format itself allows many settings. Perhaps it should be handled like BMP.

SVG

Currently no export dialog exists.

What to do if the selection or page which is to be exported contains bitmaps?

SVM

No special settings needed.

Hide color depth and pixel dimension?

TIFF

Currently no export dialog exists.

The format itself allows many settings. Here are some additional implementations desirable.

WMF

No special settings needed.

Hide color depth and pixel dimension? What to do if the selection or page which is to be exported contains bitmaps?

XPM

Currently no export dialog exists.

I don't know this format. Are there now settings needed?


Help | User Interface Element Templates | Example Spec

Migration

Old documents need no change.

Configuration

Not decided yet. Help | Configuration Table Template

File Format

Export does not effect any of OOo's file formats. Help

Help | File Format Table Template

Open Issues

  • Can the settings be saved in the user settings? Should there be settings in Tools > Options which are use to prefill the dialog?
  • The memory size might be very large. What to do if the available RAM is not enough? What to do if the memory size exceeds the setting in Tools > Options?
  • What to do if the disk space are not enough?
Personal tools