File Exchange

image thumbnail

Image Halftoning by Jarvis Method

version (221 KB) by Athi
This program converts a gray image into halftone image.


Updated 07 Jun 2011

View License

Digital halftoning is the process of converting a continuous-tone images into strictly black and white images such that, when viewed by the human visual system, the pattern creates an illusion of being a continuous shade of gray.

The binary image created by halftoning is used in binary display devices, such as desktop inkjet printers.

In this program, the input gray image will be converted into halftone image of same size using Jarvis's Error Diffusion Method.

Those who are new to Matlab Programming can see the "SampleUsage.m" file for the usage of the script "jarvisHalftone.m".

Those who are already familiar with Matlab Programming can directly use the script "jarvisHalftone.m".

Comments and Ratings (12)


hei thanks for the code but for what stays the variable T??

Abdul Wahab

Thanks for sharing the Code. I need a help, if i want to apply half toning in a specific area of image rather than whole image then what should i do. And can you please describe about the code that whats going on.

I have a question; I am trying to convert images with th Jarvis method to apply to inkjet 3Dprinting. When I use a different picture other than the lena.bmp image, I get an error in line 26:

Error in jarvisHalftone (line 26)
y= [127.5*ones(M,2) y 127.5*ones(M,2) ; 127.5*ones(2,N+4)];

Error in SampleUsage (line 20)
halftone_img = jarvisHalftone(in_img);

Could someone please help how to fix this problem?

Thanks alot!

Good Work Sir!!

Sir if i want to get back the original image from the halftoned image then how can we do the process.

Good Work Sir!!


good work

k.shankar kd

sir i want source code for Digital halftoning in CMY color images.because read this article and see the images if you give any suggestion really very helpful sir...


good word

There is not proper document on code. For a beginner will feel difficult to understand. Also coding standard is not good with variable names used, lack of comments

Otherwise, Great Work.

Description need to provide at least some links to know what is Jarvis Technique.

Ashok Kumar

great work...


Author Info updated.

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux