public String convertToHacklace(File image) {
        StringBuilder out = new StringBuilder();
        try {
            BufferedImage buffImage = ImageIO.read(image);
            if (buffImage == null) {
                System.err.println(image.getName() + ": not supported image file format");
            } else {
                int height = buffImage.getHeight();
                int width = buffImage.getWidth();
                if (checkDimension(height, width)) {
                    width = (width < 255 ? width - 1 : 254);
                    height = (height < 8 ? height - 1 : 7);
                    out.append(String.format("%s %02X", DATABLOCK_START, width + 1));
                    for (int column = 0; column <= width; column++) {
                        int hlValue = 0;
                        for (int row = height; row >= 0; row--) {
                            hlValue <<= 1;
                            if ((buffImage.getRGB(column, row) & RGB_WHITE) != RGB_WHITE) {
                                hlValue++;
                            }
                        }
                        out.append(String.format(" %02X", hlValue));
                    }
                    out.append(HEX_BYTE_MARKER);
                }
            }
        } catch (IOException ex) {
            System.err.println(image.getName() + ": failure during processing - " + ex.getMessage());
            out.setLength(0);
        }
        return out.toString();
    }