Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | ATOMS
File : Details
Login with GitLab

Dithering Grayscale Images

Ordered-Dithering of a GrayScale matrix with Bayer 1-3, Stucki 1-2, random
(3211 downloads for this version - 3211 downloads for all versions)
Details
Version
1.0
Author
Andreas Geissler
Maintainer
Andreas Geissler
Category
License
Supported Scilab Version
4.1
Creation Date
November 25, 2013
Description
            dither - Dithering of a GrayScale matrix 

Calling Sequence: y = dither(x,method)  

Parameters 
 x : Matrix with elements with range of values [1...256], representing e. g. a
grayscale image. 

 method : string with 2 characters, determing the method of dithering 

 y : dithered binary picture, matrix with elements with range of value {0,1}. 

Description 

Several mehtods of dithering are supported. Ordered Dithering methos are Bayer-1
(method='b1'), Bayer-2 (method='b2'), Bayer-3 (method='b3'), Stucki-1
(method='s1'), Stucki-2 (method='s2'). There is an additional ordered dithering
method, which is based upon a randon matrix (method='rd').  

When the 2nd rhs argument is choosen as method='rand', then random dithering is
done (Default).

Example:
---------

k=1:1:256;
[X,Y]=ndgrid(k,k);
Z=ceil(0.5 .*(X+Y)); // Generate a picture
f=gcf();
f.color_map=graycolormap(256);
Matplot(Z);
xclick();
xbasc();
zd=dither(Z,'s1'); // Do the dithering
f.color_map=graycolormap(2);
Matplot(full(zd)+1); // Show the dithered picture            
Files (2)
[2.62 kB]
Miscellaneous file
Scilab function to dither grayscale images:  
[92.53 kB]
Screenshot
Result of a dithering operation on a grayscale image
News (0)
Comments (0)
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.