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:

enter image description here

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.

  • 5
    Convert your image to SVG format then in 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
    – Joseph
    Nov 24, 2016 at 12:36
  • Seems it work fine, the only problem is to fit the flag into polygon.
    – icelandico
    Nov 24, 2016 at 13:03
  • 1
    Yes, I too have that problem sometimes. Perhaps this post might help: Stretching of QGIS symbols
    – Joseph
    Nov 24, 2016 at 13:12

3 Answers 3


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:


Gradient settings

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!

  • 1
    to force discrete gradient, put one stop at 33.2% (in this case, black) and the other one in 33.3% (red). Do the same with 66.5% and 66.6% (red and yellow, respectively).
    – aldo_tapia
    Nov 24, 2016 at 17:48

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

  • 2
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 6, 2021 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.