Thread View: comp.lang.postscript
2 messages
2 total messages
Started by Mike Hovan
Tue, 11 Aug 1992 01:17
How does Interpolation of Images work in level 2? (with broken example)
Author: Mike Hovan
Date: Tue, 11 Aug 1992 01:17
Date: Tue, 11 Aug 1992 01:17
37 lines
1361 bytes
1361 bytes
I have been playing around with some of the new features of level 2 PS for the last couple of weeks. I came across the interpolation feature of images and I was wondering if anyone had some simple examples. I have tried (in vain) to get an interpolated image to produce a different result than an uninterpolated image. Here is what I have been using to test: --CUT HERE----CUT HERE----CUT HERE----CUT HERE----CUT HERE-- %!PS-Adobe-3.0 /DeviceRGB setcolorspace 144 144 translate 144 144 scale << /ImageType 1 /Width 2 /Height 2 /BitsPerComponent 8 /MultipleDataSources true /ImageMatrix [2 0 0 -2 0 2] /Decode [0 1 0 1 0 1] /Interpolate true /DataSource [<FF 00 00 00> <00 FF 00 00> <00 00 FF 00>] >> image --CUT HERE----CUT HERE----CUT HERE----CUT HERE----CUT HERE-- If you have any suggestions or examples I would appreciate them. Thanks, Mike Hovan RDR, Inc. mhovan@rdr.com (NeXTMAIL accepted)
Re: How does Interpolation of Images work in level 2? (with broken example)
Author: Jim DeLaHunt
Date: Fri, 21 Aug 1992 04:27
Date: Fri, 21 Aug 1992 04:27
44 lines
2210 bytes
2210 bytes
In article <1992Aug11.011717.1588@rdr.com> mhovan@rdr.com writes:
>I was wondering if anyone had
>some simple examples. I have tried (in vain) to get an interpolated
>image to produce a different result than an uninterpolated image.
Try this:
--CUT HERE----CUT HERE----CUT HERE----CUT HERE----CUT HERE--
%!PS-Adobe-3.0
/DeviceGray setcolorspace
144 144 translate 144 144 scale
<<
/ImageType 1
/Width 8 /Height 8
/BitsPerComponent 1
/MultipleDataSources true
/ImageMatrix [8 0 0 -8 0 8]
/Decode [0 1]
/Interpolate true
/DataSource <FF 7F 3F 1F 0F 07 03 01>
>>
image
--CUT HERE----CUT HERE----CUT HERE----CUT HERE----CUT HERE--
On my LaserWriter IIg this code produces a dramatic difference between
/Interpolate true and /Interpolate false.
The spec says (PLRM p. 222):
"[The image interpolation algorithm] *attempts* to make a smooth
transition between image values." [my emphasis]
In other words, neither the algorithm nor the range of cases when it is
applied is specified. It seems that in the implementations you and I
are using, the algorithm is not applied for 24 bits-per-pixel images, but
is applied for 1 bit-per-pixel images.
There are many features of the PostScript language for which the interpreter
is *allowed* to make things better, but is not *required*. Different
implementations will do different things. The trick is to not make your
code dependent on what any particular implementation does.
> Mike Hovan, RDR, Inc., mhovan@rdr.com (NeXTMAIL accepted)
--Jim DeLaHunt, Developer Support, Adobe Systems Incorporated
delahunt@adobe.com ...!{apple,decwrl}!adobe!delahunt +1-415-962-3790
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads