Every answer I found on Internet needed to know the filename or the URL of the image in order to make conversion. I only have access to the image instance, I can't access it on the filesystem. I don't have its URL nor filename.
Typically, that's the kind of code I found but it's not relevant :
File imgPath = new File(ImageName);
BufferedImage bufferedImage = ImageIO.read(imgPath);