Here you can find the source of toPixelByte(float floatValue)
static byte toPixelByte(float floatValue)
//package com.java2s; //License from project: Apache License public class Main { static byte toPixelByte(float floatValue) { return (byte) (floatValue * (Byte.MAX_VALUE - Byte.MIN_VALUE) + Byte.MIN_VALUE); }/*w w w. java 2 s .c om*/ }