What I want to do is to fill a polygon (country) with a graphic file in any format (*.jpg, .bmp, .png).
It should look like this:
I'm aware that GIS soft is not proper for such an operation but maybe is there any option to do it only in QGIS.
Use the "raster image fill" style on the polygon layer. This fill style allows drawing a polygon using a PNG/JPG/BMP/... etc.
Using a gradient, you can obtain this:
You have to use two stops at the border between colours, one for each colour, to make sure the result is neat. SVG would in any case be the way to go for any flag with more than straight lines!
This can be done using Python by creating image patches and clipping images using the patches. Needs Python libraries like shapely, cartopy and GeoPandas. here
Layer Properties > Style
, change the Simple fill layer type option to SVG fill. You can look at this post to see how to import your svg files into QGIS: Importing SVG symbols into QGIS