Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1290

Re: Followup: Making an image into a pattern

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Thu, 07 Mar 2013 07:55:44 -0600
From John Deubert <john@acumentraining.com>
Organization Acumen Training
Newsgroups comp.lang.postscript
Date Thu, 7 Mar 2013 05:55:43 -0800
Message-ID <2013030705554335162-john@acumentrainingcom> (permalink)
References <d7b639ca-28cd-4922-9583-67edf417cdcd@googlegroups.com>
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Subject Re: Followup: Making an image into a pattern
User-Agent Unison/2.1.10
Lines 109
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-Z6jIt5LKlJJpoKOuYFg3ZCuj123nHZcK78OTGBesOeBwEksUBESpCpYWP68ZNVbSID51CSHUQeTGepK!gN5MFQKCyNPJpkTgDFhl+Bdoka/RoChpwU96BjNfO7ygqvjGOEXUVeQeTld1zveArsBskldQ
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 3812
Xref csiph.com comp.lang.postscript:1290

Show key headers only | View raw


On 2013-03-07 12:57:17 +0000, alamraquib@gmail.com said:

> On Friday, September 25, 1998 12:30:00 PM UTC+5:30, Darrin Cardani wrote:
>> Thanks to Martin Bailey for his help with getting an image into a pattern
>> so I could apply an imagemask to it. For those of you who are interested, I
>> learned the following things in my search:
>> 
>> If you want to use a color image as a pattern, you must use the 5 operand
>> version of the colorimage command. It will not accept the dictionary
>> version of the command. Apparently this is because the colorimage command
>> does not require the current colorspace to be specified.
>> 
>> If you then want to apply an imagemask to it, you must also use the 5
>> operand version of imagemask, rather than the dictionary version. I don't
>> really understand why, but that's the way it is.
>> 
>> And you cannot use TilingType 2 in your pattern, I believe.
>> 
>> So my working code looks like this:
>> 
>> [...headers deleted...]
>> currentfile 4096 string
>> %%BeginBinary:  4107
>> readstring
>> [...4096 bytes deleted...]
>> %%EndBinary
>> pop
>> /ImageData  exch def
>> 
>> /ImageDraw {
>> 32 32 scale
>> 32 32 8
>> [ 32 0 0 -32 0 32 ]
>> { ImageData }
>> false 4
>> colorimage
>> } bind def
>> 
>> <<
>> /PatternType    1
>> /PaintType      1
>> /TilingType     1
>> /BBox           [ 0 0 32 32 ]
>> /XStep          32
>> /YStep          32
>> /PaintProc  {
>> begin
>> ImageDraw
>> end
>> }
>>>> 
>> matrix
>> makepattern
>> 
>> /ImagePat exch def
>> 
>> /Pattern setcolorspace
>> ImagePat setcolor
>> 
>> 72 72 scale
>> 
>> currentfile 128 string
>> %%BeginBinary:  139
>> readstring
>> [...128 bytes of mask data deleted...]
>> %%EndBinary
>> pop
>> /MaskData   exch def
>> 32 32 true [ 32 0 0 -32 0 32 ] { MaskData }
>> imagemask
>> 
>> showpage
>> 
>> I hope that's helpful to someone!
>> 
>> Darrin
>> 
>> --
>> Darrin Cardani
> 
> Hello,
> I am also working on the Patterns in PostScript.
> My image Data size is more than 65535. How that can be done. Could you 
> please provide a solution.


Hi -

Issues 21-23 (December 2002 - February 2003) of the Acumen Journal 
present a lengthy discussion of the using images (of arbitrary size) in 
a PostScript form; the techniques presented apply also to using images 
in a pattern.

The Journal is free for the downloading at 
www.acumentraining.com/acumenjournal.html.

- John

-- 
========
John Deubert
Acumen Training
PostScript & PDF Engineering Classes & Consulting
www.acumentraining.com

Learn PostScript programming techniques
Read the free Acumen Journal
acumentraining.com/acumenjournal.html

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Followup: Making an image into a pattern alamraquib@gmail.com - 2013-03-07 04:57 -0800
  Re: Followup: Making an image into a pattern John Deubert <john@acumentraining.com> - 2013-03-07 05:55 -0800
  Re: Followup: Making an image into a pattern John Deubert <john@acumentraining.com> - 2013-03-07 06:59 -0800
    Re: Followup: Making an image into a pattern John Deubert <john@acumentraining.com> - 2013-03-07 07:16 -0800
      Re: Followup: Making an image into a pattern luser- -droog <mijoryx@yahoo.com> - 2013-03-10 22:53 -0700
        Re: Followup: Making an image into a pattern John Deubert <john@acumentraining.com> - 2013-03-11 06:17 -0700

csiph-web