Here is a solution using gdal:translate
:
# variables to modify
picture_path ="/path/to/your/picture.png"
extent = QgsRectangle(2.05287815000000018, 44.10549260999999888, 7.19556459999999998, 46.81428704999999724)
crs = QgsCoordinateReferenceSystem.fromEpsgId(4326)
# add picture to QGIS
picture =QgsRasterLayer(picture_path, 'picture')
# give picture the right coordinate reference system
picture.setCrs(QgsProject.instance().crs())
# use param algorithm with your extent to translate the picture
translate_param = {'INPUT': picture, 'TARGET_CRS': QgsProject.instance().crs(), 'NODATA': None,
'COPY_SUBDATASETS': False, 'OPTIONS': '',
'EXTRA': '-a_ullr '+str(extent.xMinimum())+' '+str(extent.yMaximum())+' '+str(extent.xMaximum())+' '+str(extent.yMinimum()),
'DATA_TYPE': 0, 'OUTPUT': 'TEMPORARY_OUTPUT'}
translate = processing.runAndLoadResults("gdal:translate", translate_param)