This question already has an answer here:

I'm working on creating maps using Cesium. Now my client needs to export the viewport map to an image.

I'm already exporting to PNG/JPEG but now I need to create a GeoTiff.

Is there any way to convert a PNG or JPEG to a GeoTiff? I know the map bounding box.

The tools I can use is Java and Javascript. If the things goes hard I can make an effort to try automatize some GDAL requests but is important to know I can't have GUI like QGIS or similar.

I'm looking on Geotools but just found tools to convert geotiff to JPEG.

I know I have no code or any big effort to put here but I swear I've found nothing to help until now.

Looking here now...

marked as duplicate by Magno C, Community Sep 30 at 22:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.