Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
simFTPServer Xtra 1.0 Beta
Message Box Behavior
Res Mode
Bouncing Ball
Save text to a file
Director 8 Primer
Fill Gradient to a Vector Shape
Printing Acrobat files with Buddy API
Forward and Reverse (Shitf+Tab) between Fields
ToolTips for Shockwave 3D
 

 

 

Behavior Dither Black and White Image - Imaging Lingo

Added on 8/23/2005

 

Compatibilities:
D8 D8_5 D9 Mac Parent PC Shockwave

This item has not yet been rated

Author: Chunick (website)

This algorithm is similar to my posterize code, but it allows someone to dither a black and white, 1-bit image.

-- Dither Black and White Image
-- 2005 by Josh Chunick (josh@chunick.com)
-- This code is free to use in commercial applications
-- or however you want. If you use this code you
-- must keep the comments, including this message,
-- intact. Feel free to add any changes or make
-- improvements.

-- imageRef is the image object
-- thePalette can be: systemwin, systemmac, rainbow,
-- web216, metallic, pastels, vivid, ntsc
-- theDither can be: true, false, 1215, 1969

on blackwhiteDither (imageRef, thePalette, theDither)
  posterizedImage = image (imageRef.width, imageRef.height, 8, thePalette)
  posterizedImage.copyPixels (imageRef, imageRef.rect, imageRef.rect, [#dither: theDither])
  b_wImage = image (imageRef.width, imageRef.height, 1)
  b_wImage.copyPixels (posterizedImage, imageRef.rect, imageRef.rect)
  return b_wImage
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail