+ /**
+ * Return the {@link Character} corresponding to this colour in
+ * {@link Mode#ASCII} mode.
+ *
+ * @param pixel
+ * the colour
+ *
+ * @return the {@link Character} to use
+ */
+ private char getAsciiChar(int pixel) {
+ float brigthness = getBrightness(pixel);
+ if (brigthness < 0.20) {
+ return ' ';
+ } else if (brigthness < 0.40) {
+ return '.';
+ } else if (brigthness < 0.60) {
+ return '+';
+ } else if (brigthness < 0.80) {
+ return '*';
+ } else {
+ return '#';
+ }
+ }
+
+ /**
+ * Return the {@link Character} corresponding to this colour in
+ * {@link Mode#DITHERING} mode.
+ *
+ * @param pixel
+ * the colour
+ *
+ * @return the {@link Character} to use
+ */
+ private char getDitheringChar(int pixel) {
+ float brigthness = getBrightness(pixel);
+ if (brigthness < 0.20) {
+ return ' ';
+ } else if (brigthness < 0.40) {
+ return '░';
+ } else if (brigthness < 0.60) {
+ return '▒';
+ } else if (brigthness < 0.80) {
+ return '▓';
+ } else {
+ return '█';
+ }
+ }
+
+ /**
+ * Return the {@link Character} corresponding to the 4 given colours in
+ * {@link Mode#DOUBLE_RESOLUTION} or {@link Mode#DOUBLE_DITHERING} mode.
+ *
+ * @param upperleft
+ * the upper left colour
+ * @param upperright
+ * the upper right colour
+ * @param lowerleft
+ * the lower left colour
+ * @param lowerright
+ * the lower right colour
+ * @param dithering
+ * TRUE to use {@link Mode#DOUBLE_DITHERING}, FALSE for
+ * {@link Mode#DOUBLE_RESOLUTION}
+ *
+ * @return the {@link Character} to use
+ */
+ private char getBlockChar(int upperleft, int upperright, int lowerleft,
+ int lowerright, boolean dithering) {