Open adrhill opened 3 years ago
what's the issue sir
More reference: http://caca.zoy.org/study/part4.html
Hi @Jay-sanjay,
together with issues #24 and #26, this issue tracks a dithering algorithm that would be nice to have in DitherPunk.jl.
For a list of already implemented methods, refer to the list in the README and the gallery.
If you are looking to contribute the direct binary search algorithm to DitherPunk.jl, you only need to create an algorithm struct that is a subtype of AbstractDither
, a function binarydither!
and optionally a function colordither
. The source code of ClosestColor
is probably the best entry point into the code.
I would be more than glad to assist you if you are interested in contributing! :)
@adrhill Sir, while implementing the binarydither! ( ) function should it return 1 if pixel value in the input image is greater than the threshold and 0 in the else case . What must be done could you please assist me further !
Hi @Jay-sanjay, functions binarydither!
are supposed to modify the argument output
in-place.
In-place modifying functions in Julia are usually indicated by an exclamation point !
in their name by convention.
Writing a 1
into out
will turn that pixel white.
Writing a 0
into out
will turn that pixel black.
I hope the following screenshot helps to illustrate this:
Yes , Sir should the algorithm be something like : binarydither! function should iterate over each pixel in the input image and assign the output pixel to the closest color in the color palette and the distances between the two colors measured via theirdiif. in grayscale values if it is greater than thresold , return 1 else return 0.
is it enough
As described in [1] and Chapter 7 of Modern Digital Halftoning by Lau & Are.