uk.co.silentsoftware.core.converters.image.errordiffusionstrategy
Class LowErrorAtkinsonDitherStrategy
java.lang.Object
uk.co.silentsoftware.core.converters.image.errordiffusionstrategy.AbstractErrorDiffusionDitherStrategy
uk.co.silentsoftware.core.converters.image.errordiffusionstrategy.LowErrorAtkinsonDitherStrategy
- All Implemented Interfaces:
- ErrorDiffusionDitherStrategy
public class LowErrorAtkinsonDitherStrategy
- extends AbstractErrorDiffusionDitherStrategy
- implements ErrorDiffusionDitherStrategy
Special low error dither strategy especially for Spectrum image conversion
and only (currently) in use in this program, based on the Atkinson distribution
but using only 25% error distribution. This strategy tends to get the best
results in most cases, however images with high detail but similar colours
(e.g. blues underwater/red light on a face etc etc) may lose some detail depending
on pre process contrast. The trade off is that the error distribution is far less
likely to propagate to surrounding *ZX Spectrum attribute blocks* resulting in
less colour clash than the classical diffusion algorithms.
This strategy was devised by me, Benjamin Brown, based on the original Atkinson
distribution of error, if anybody feels like publishing it :)
|
Method Summary |
void |
distributeError(java.awt.image.BufferedImage output,
int oldPixel,
int newPixel,
int x,
int y,
java.lang.Integer boundX,
java.lang.Integer boundY)
Distributes the error on the output image at the
given x,y, using the difference between the original
(old) pixel and the new pixel. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TWENTY_FOURTH
public static final double TWENTY_FOURTH
- See Also:
- Constant Field Values
LowErrorAtkinsonDitherStrategy
public LowErrorAtkinsonDitherStrategy()
distributeError
public void distributeError(java.awt.image.BufferedImage output,
int oldPixel,
int newPixel,
int x,
int y,
java.lang.Integer boundX,
java.lang.Integer boundY)
- Description copied from interface:
ErrorDiffusionDitherStrategy
- Distributes the error on the output image at the
given x,y, using the difference between the original
(old) pixel and the new pixel.
- Specified by:
distributeError in interface ErrorDiffusionDitherStrategy
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object