Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
images [2016/02/22 10:29] christian [Implementation] |
images [2016/02/22 17:09] christian [Implementation] |
||
---|---|---|---|
Line 100: | Line 100: | ||
This default implementation ('' | This default implementation ('' | ||
- | Some conversions can be greatly sped up by exploiting the internal byte organization of the image bits and transfering them directly. While this is possible for many useful forms, it is not possible in general (think of a Smalltalk image with a big palette of more than 255 colors). The following conversions are currently optimized: | + | Some conversions can be greatly sped up (one or two orders of magnitude) |
+ | |||
+ | The following conversions are currently optimized: | ||
* Depth1Image for Black and white images and masks | * Depth1Image for Black and white images and masks | ||
* Depth24Image with 8 bit RGB | * Depth24Image with 8 bit RGB | ||
* Depth32Image for 8 bit RGB and BGR images taken from the '' | * Depth32Image for 8 bit RGB and BGR images taken from the '' | ||
* Depth32Image for 8 bit ARGB and ABGR | * Depth32Image for 8 bit ARGB and ABGR | ||
+ | * Depth{2 4 8)Image with a MappedPalette. | ||
+ | |||
+ | The direct conversion of an image with a mapped palette is special. Since RGB color components are represented with 13 bits in Smalltalk, but using 8 bits in PDF, a Smalltalk palette may have more than one entry for one 8 bit RGB color. This is correctly handled when converting the image pixel by pixel, because each color is stored as 8 bit color in the PDF /Indexed colorspace, thereby aligning different 3x13 bit colors to the same 3x8 bit color. | ||
+ | |||
+ | When converting such image optimized by converting the palette and using the same indexes for the pixels allowing direct reuse of the image bytes, the /Indexed colorspace may contain several entries for the same color. Converting such an ImageXObject back to Smalltalk will not recreate the least significant 5 bits leading to slightly different colors as in the original. But for 8 bit RGB usage, it will not make any difference. Although this does not feel proper, it will not make much difference in practice. But the speed up of the optimization is worth it. | ||
===== Disclaimer ===== | ===== Disclaimer ===== | ||