🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1844

Re: How does Interpolation of Images work in level 2? (with broken example)

#1844
From: Jim DeLaHunt
Date: Fri, 21 Aug 1992 04:27
44 lines
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
Technical Details
Message-ID: <1992Aug21.042703.1230@adobe.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!decwrl!adobe!delahunt
References: <1992Aug11.011717.1588@rdr.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!decwrl!adobe!delahunt
From: delahunt@adobe.com (Jim DeLaHunt)
Subject: Re: How does Interpolation of Images work in level 2? (with broken example)
Message-ID: <1992Aug21.042703.1230@adobe.com>
Summary: interpolation algorithm is not specified
Keywords: Interpolation
Sender: usenet@adobe.com (USENET NEWS)
Organization: Adobe Systems Incorporated
References: <1992Aug11.011717.1588@rdr.com>
Date: Fri, 21 Aug 1992 04:27:03 GMT
Lines: 44