fix for https://github.com/osmdroid/osmdroid/issues/249
@param image
174524
public void setDirectionArrow(final Bitmap image){
		this.DIRECTION_ARROW = image;
		this.DIRECTION_ARROW_CENTER_X = this.DIRECTION_ARROW.getWidth() / 2 - 0.5f;
		this.DIRECTION_ARROW_CENTER_Y = this.DIRECTION_ARROW.getHeight() / 2 - 0.5f;
		this.DIRECTION_ARROW_HEIGHT = this.DIRECTION_ARROW.getHeight();
		this.DIRECTION_ARROW_WIDTH = this.DIRECTION_ARROW.getWidth();
	}
288472
private static String read(BufferedImage image) throws NotFoundException {
        LuminanceSource source = new BufferedImageLuminanceSource(image);
        Binarizer binarizer = new HybridBinarizer(source);
        BinaryBitmap binaryBitmap = new BinaryBitmap(binarizer);
        Result result = new MultiFormatReader().decode(binaryBitmap);
        return result.getText();
    }
464421
public static JComponent generateComponent(Image image) {

        if (image == null) {
            return new LabelUIResource("Image is null");
        }

        return SwingUtils.generateComponent(new ImageIcon(image));
    }
540689
@Override
    public void onImage(ResourceReference reference, boolean freestanding, Map<String, String> parameters)
    {
        saveEvent(EventType.ON_IMAGE, reference, freestanding, parameters);
    }
122444
public long image(int group, String image) {
		return send(new Filter(false, String.valueOf(group)), null, "image", image);
	}
205586
public void validateImageType(BufferedImage image) {
		if (image == null) {
			throw new GeoPackageException("The image is null");
		}
		if (image.getColorModel().getTransferType() != DataBuffer.TYPE_USHORT) {
			throw new GeoPackageException(
					"The coverage data tile is expected to be a 16 bit unsigned short, actual: "
							+ image.getColorModel().getTransferType());
		}
	}
109912
public static void writePng(Image image, OutputStream out) throws IORuntimeException {
		write(image, IMAGE_TYPE_PNG, out);
	}
1143470
public static byte[] getBufferByteArray(BufferedImage image) {
		ByteArrayOutputStream os = new ByteArrayOutputStream();
		try {
			ImageIO.write(image, "png", os);
		} catch (IOException e) {
			logger.error("getBufferByteArray error", e);
		}
		return os.toByteArray();
	}
821178
public static void releaseGraphicsForImage(Image image) throws SlickException {
		Graphics g = (Graphics) graphics.remove(image.getTexture());
		
		if (g != null) {
			g.destroy();
		}
	}
604732
private void drawLine(BufferedImage image) {
        Random r = new Random();
        Graphics2D g2 = (Graphics2D) image.getGraphics();
        int max = this.textLength * this.linePower;
        for (int i = 0; i < max; i++) {
            int x1 = r.nextInt(w);
            int y1 = r.nextInt(h);
            int x2 = r.nextInt(w);
            int y2 = r.nextInt(h);
            g2.setStroke(new BasicStroke(1.5F));
            g2.setColor(this.randomColor());
            g2.drawLine(x1, y1, x2, y2);
        }
        g2.dispose();
    }
325552
private void createSections(final BufferedImage IMAGE) {
        if (!getSections().isEmpty() && bImage != null) {
            final double OUTER_RADIUS = bImage.getWidth() * 0.3411214953f;
            final double INNER_RADIUS = isExpandedSectionsEnabled() ? OUTER_RADIUS - bImage.getWidth() * 0.12f : OUTER_RADIUS - bImage.getWidth() * 0.023364486f;
            final Ellipse2D INNER = new Ellipse2D.Double(0, 0, 1, 1);

            switch (getOrientation()) {
                case NORTH_EAST:
                    INNER.setFrame(-bImage.getWidth() * 0.45, bImage.getWidth() * 0.195, 4 * INNER_RADIUS, 4 * INNER_RADIUS);
                    break;

                case SOUTH_EAST:
                    INNER.setFrame(-bImage.getWidth() * 0.45, -bImage.getWidth() * 0.45, 4 * INNER_RADIUS, 4 * INNER_RADIUS);
                    break;

                case SOUTH_WEST:
                    INNER.setFrame(bImage.getWidth() * 0.195, -bImage.getWidth() * 0.45, 4 * INNER_RADIUS, 4 * INNER_RADIUS);
                    break;

                case NORTH_WEST:

                default:
                    final double INNER_OFFSET = isExpandedSectionsEnabled() ? bImage.getWidth() * 0.38 : bImage.getWidth() * 0.195;
                    INNER.setFrame(INNER_OFFSET, INNER_OFFSET, 4 * INNER_RADIUS, 4 * INNER_RADIUS);
                    break;
            }

            double stopAngle;
            double startAngle;
            final Point2D SECTION_OFFSET = new Point2D.Double(0, 0);

            for (Section section : getSections()) {
                switch (getOrientation()) {
                    case NORTH_EAST:
                        if (!isLogScale()) {
                            stopAngle = 90 - Math.toDegrees((getMaxValue() - section.getStop() - getMinValue()) * getAngleStep());
                            startAngle = 90 - Math.toDegrees((getMaxValue() - section.getStart() - getMinValue()) * getAngleStep());
                        } else {
                            stopAngle = 90 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStop() - getMinValue()) * getLogAngleStep());
                            startAngle = 90 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStart() - getMinValue()) * getLogAngleStep());
                        }
                        SECTION_OFFSET.setLocation(-bImage.getWidth() * 0.403271028, bImage.getWidth() * 0.148271028);
                        break;

                    case SOUTH_EAST:
                        if (!isLogScale()) {
                            stopAngle = 0 - Math.toDegrees((getMaxValue() - section.getStop() - getMinValue()) * getAngleStep());
                            startAngle = 0 - Math.toDegrees((getMaxValue() - section.getStart() - getMinValue()) * getAngleStep());
                        } else {
                            stopAngle = 0 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStop() - getMinValue()) * getLogAngleStep());
                            startAngle = 0 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStart() - getMinValue()) * getLogAngleStep());
                        }
                        SECTION_OFFSET.setLocation(-bImage.getWidth() * 0.403271028, -bImage.getWidth() * 0.403271028);
                        break;

                    case SOUTH_WEST:
                        if (!isLogScale()) {
                            stopAngle = 270 - Math.toDegrees((section.getStop() - getMinValue()) * getAngleStep());
                            startAngle = 270 - Math.toDegrees((section.getStart() - getMinValue()) * getAngleStep());
                        } else {
                            stopAngle = 270 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStop() - getMinValue()) * getLogAngleStep());
                            startAngle = 270 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStart() - getMinValue()) * getLogAngleStep());
                        }
                        SECTION_OFFSET.setLocation(bImage.getWidth() * 0.148271028, -bImage.getWidth() * 0.403271028);
                        break;

                    case NORTH_WEST:

                    default:
                        if (!isLogScale()) {
                            stopAngle = 180 - Math.toDegrees((section.getStop() - getMinValue()) * getAngleStep());
                            startAngle = 180 - Math.toDegrees((section.getStart() - getMinValue()) * getAngleStep());
                        } else {
                            stopAngle = 180 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStop() - getMinValue()) * getLogAngleStep());
                            startAngle = 180 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStart() - getMinValue()) * getLogAngleStep());
                        }
                        SECTION_OFFSET.setLocation(bImage.getWidth() * 0.148271028, bImage.getWidth() * 0.148271028);
                        break;
                }

                final Arc2D OUTER_ARC = new Arc2D.Double(java.awt.geom.Arc2D.PIE);
                OUTER_ARC.setFrame(SECTION_OFFSET.getX(), SECTION_OFFSET.getY(), 4 * OUTER_RADIUS, 4 * OUTER_RADIUS);
                OUTER_ARC.setAngleStart(startAngle);
                OUTER_ARC.setAngleExtent(stopAngle - startAngle);
                final Area SECTION = new Area(OUTER_ARC);

                SECTION.subtract(new java.awt.geom.Area(INNER));

                section.setSectionArea(SECTION);
            }

            // Draw the sections
            if (isSectionsVisible() && IMAGE != null) {
                final Graphics2D G2 = IMAGE.createGraphics();
                G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                for (Section section : getSections()) {
                    G2.setColor(isTransparentAreasEnabled() ? section.getTransparentColor() : section.getColor());
                    G2.fill(section.getSectionArea());
                }
                G2.dispose();
            }
        }
    }
1206235
function(image) {
        if (!this.isActive())
            throw "Trying to set image of texture that isn't active";
        this.width = image.width;
        this.height = image.height;
        this.size = image.width * image.height;
        this.powerOfTwo = !(
            Math.log(image.width) / Math.LN2 !==
                Math.floor(Math.log(image.width) / Math.LN2) ||
            Math.log(image.height) / Math.LN2 !==
                Math.floor(Math.log(image.height) / Math.LN2)
        );
        var gl = this.gl;
        gl.texImage2D(
            gl.TEXTURE_2D,
            0,
            gl.RGBA,
            gl.RGBA,
            gl.UNSIGNED_BYTE,
            image
        );
    }
602654
public void setImageUI(final BufferedImage image) {
		BoofSwingUtil.invokeNowOrLater(() -> {
			repaintJustImage(ImagePanel.this.img,adjustmentGUI);
			ImagePanel.this.img = image;
			repaintJustImage(ImagePanel.this.img,adjustmentGUI);
		});
	}
257008
public BufferedImage put(IconRow iconRow, BufferedImage image) {
		return put(iconRow.getId(), image);
	}
1176951
protected Graphics2D getGraphics(BufferedImage image) {
		Graphics2D graphics = image.createGraphics();
		graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
		return graphics;
	}
586651
public void setImage(GrayF32 image) {

		scaleSpace.initialize(image);

		usedScales.clear();
		do {
			for (int i = 0; i < scaleSpace.getNumScales(); i++) {
				GrayF32 scaleImage = scaleSpace.getImageScale(i);
				double sigma = scaleSpace.computeSigmaScale(i);
				double pixelCurrentToInput = scaleSpace.pixelScaleCurrentToInput();

				ImageScale scale = allScales.get(usedScales.size());
				scale.derivX.reshape(scaleImage.width,scaleImage.height);
				scale.derivY.reshape(scaleImage.width,scaleImage.height);

				gradient.process(scaleImage,scale.derivX,scale.derivY);
				scale.imageToInput = pixelCurrentToInput;
				scale.sigma = sigma;

				usedScales.add(scale);
			}
		} while( scaleSpace.computeNextOctave() );
	}
243676
public void addHiDpiImage(String factor, CmsJspImageBean image) {

        if (m_hiDpiImages == null) {
            m_hiDpiImages = CmsCollectionsGenericWrapper.createLazyMap(new CmsScaleHiDpiTransformer());
        }
        m_hiDpiImages.put(factor, image);
    }