public static Point inverseTransformPoint(AffineTransform af, Point pt) {
        Point2D src = new Point2D.Float(pt.x, pt.y);
        try {
            Point2D dest = af.inverseTransform(src, null);
            return new Point((int) Math.floor(dest.getX()), (int) Math.floor(dest.getY()));
        } catch (Exception e) {
            e.printStackTrace();
            return new Point(0, 0);
        }
    }
Given an arbitrary point, get the point with the inverse given transform.

@param af AffineTransform
@param pt source point
@return point after transform
plugins/org.jkiss.dbeaver.ui.editors.image/src/org/jkiss/dbeaver/ui/controls/imageview/ImageViewUtil.java