[Note: This was first published as a Facebook Note on July 7, 2015. I am making it available here to add to the Inkscape tutorials.]
Tired of waiting for Facebook to put out an app where you can overlay a country flag’s colors on your profile pic to show your sympathy? Why not make your own? Inkscape easily allows you to do that. But that means you’ll need to spend some time learning how to use a vector graphics program, if you don’t know how to yet. Inkscape is a simple-looking vector graphics program and it only outputs to PNG, but you can carry it as a portable app on a USB pen drive. Here’s how your Inkscape-made profile pic can look:
(Featuring the face of Carl Nilsson-Polias, one of Google Search’s most famous faces – his face is among the top results when you Google ‘profile picture’. 😝 You’ll need:
Tired of waiting for Facebook to put out an app where you can overlay a country flag’s colors on your profile pic to show your sympathy? Why not make your own? Inkscape easily allows you to do that. But that means you’ll need to spend some time learning how to use a vector graphics program, if you don’t know how to yet. Inkscape is a simple-looking vector graphics program and it only outputs to PNG, but you can carry it as a portable app on a USB pen drive. Here’s how your Inkscape-made profile pic can look:
(Featuring the face of Carl Nilsson-Polias, one of Google Search’s most famous faces – his face is among the top results when you Google ‘profile picture’. 😝 You’ll need:
- A computer with internet access – desktop or laptop;
- Inkscape – you can install on your PC or just download the portable version (or, for Mac OS users, follow these steps).
Let’s begin
1. Set up your workspace
Since a Facebook profile pic is only 180 × 180 pixels, we need to make your Inkscape document square. Here I set it up to 400 pixels wide × 400 pixels high (should be enough for my screen resolution to work with – Facebook will reduce its size on uploading). Make it bigger if you have one of those Retina™ or Ultra HD displays.
Next make two layers: the ‘background’ layer and the ‘overlay’ layer: Use Shift+Ctrl+L command to bring up the layer dialog. Rename the bottom layer (default is ‘layer 1’) as ‘background’ and name the top layer ‘overlay’.
While you’re on the ‘overlay’ layer dialog, set the layer’s ‘blend mode’ to ‘lighten’. What this does is to selectively show colors in your background layer: White elements in the layer below (‘background’ layer) show up as white, grays show up as gray, and blacks show up as whatever colors are in the ‘overlay’ layer (basically making a weird duotone, where black is replaced by color and the grays stay gray):
| ||
The problem with this layer blend mode is that 100% white objects need to be made less opaque (i.e., more transparent) in order to show anything in the layer beneath.
2. Add profile pic
Use the layer dialog to go to the background layer. Drag and drop (or go to File > Import) your desired profile pic to the page. You will be asked to either link or embed it in the Inkscape file. Choose embed if you don’t want to be carrying copies of your profile pic around for Inkscape to link to. Embedding will increase the size of Inkscape files, however. The profile pics, for our purpose, should have a good contrast between the face and its backdrop (preferably dramatic contrast – think Caravaggio) . As much as possible, use a black and white profile pic but you can always use Inkscape’s ‘desaturate’ filter for the job:
Center the profile pic on the page (it should be at least the same size as your document – 400 × 400 pixels in this case). To center, do Shift+Ctrl+A and the align dialog will pull up. Center horizontally and vertically relative to page:
3. Add the flag overlay
Now go back to the ‘overlay’ layer and import your flag overlay (you can just drag-and-drop the file on Inkscape).
Where can you find a country flag? Search Wikipedia for ‘Flag of ’. Wikipedia usually has them in two formats: bitmap (PNG or JPG) and vector (SVG). (Here’s a video comparison between bitmap and vector graphics.) SVG is Inkscape’s native file format so importing SVGs is as easy as drag and drop:
Recall that you have to make pure white objects in the ‘overlay’ layer less opaque (via the Fill > Opacity slider) in order to show objects in the layer below.
Vector formats allow for greater control because, not only do they afford a sharp output, you can also set the white components’ opacity to 70.8 (or less – adjust to your liking – I find 70.8% lets me see underlying image details while still hinting the overlay is "white") while having the other colored components at full opacity (and therefore, full saturation). If you only have a bitmap flag, and it has a white component, you need to set the whole image’s opacity to 70.8 (or less, adjust to your preference) so the white will show something from the background layer but this results to making the other colors dull (as shown below).
Bitmap Overlay
Here we have a bitmap flag in the overlay layer. Since it is just one image, all the colors in the flag will have an opacity of 70.8 when we adjust the opacity slider so that the white portions will show something underneath. This makes the colored portions dull (except black) – like in most profile pic overlay sites (e.g. ProfilePictureFlag.com or ProfileOverlays.com):
Vector Overlay |
Here we have a vector flag (SVG downloaded from Wikipedia). Notice we only adjusted the opacity of the white portion of the flag while the other colors have full saturation:
I like the fully-saturated colors on the right, but your tastes may differ.
More on whites
There’s a bit of an advanced trick that needs to be done if your vector flag has ‘white-on-color’ components. Since vector objects are ‘piled’ one on top of another, if a vector flag has a colored background and white components, white objects tend to be on top of the colored background. If we just decrease the opacity of the white portion, a light version of the color of the background will show through, along with your picture in the background layer. Here, a flag has a green background and a white circle on top of it. We just adjusted the opacity of the white circle to 70.8:
It’s not pretty. The trick is to make a hole in the colored background so the white portion is unimpeded (and the white stays uncolored). Here’s one with a hole (covered by the white component with opacity reduced to 70.8):
This is the effect we want. Here’s the same pic showing the hole (which is the same size and shape as the white circle):
What you need to do is to get inside your flag group (if your flag is grouped, which usually is the case) by right-clicking the group and selecting ‘Enter group ...’ in the dropdown. Next select the white object. Make sure it is not a group but a whole path. Duplicate it (Ctrl+D; if you didn’t adjust the duplicate distance setting, you won’t notice that the object was already duplicated because the duplicate would be over the original object). Select the duplicate object and then press Shift and select the background object. You’ll have two selected objects, the duplicated white object and the colored flag background. Make sure both are paths, not groups (ungroup grouped components; Ctrl+U), and do a ‘Difference’ path operation. This will delete the top object (the reason why we duplicated it first) and make a hole on the flag background. Then reduce the opacity of the remaining white object:
(This could get tricky if you have a white object on top of several colored backgrounds – in the Philippine flag below, for example, I had to duplicate the white triangle twice and use the duplicates one by one to cut portions off the blue and red components.)
Interestingly, color-over-white doesn’t seem to have a problem. Also, you won’t have this problem if your overlay is a bitmap.
Export (Shift+Ctrl+E) the whole page as PNG and you’ll be able to upload it to Facebook as your profile pic.
Also note the main difference of this technique from the conventional method of overlaying a colored transparency over your photo is that, here, what becomes colored are the black areas, while in the conventional method, the white areas are the ones colored. The method we have here keeps flag colors bright and image contrast relatively high (unless your flag has a lot of ‘light’ colors that don’t go well with white like yellow, or orange). ;-)
Here are sample profile pics with different flags (bringing back in Carl Nilsson-Polias):
|
Have fun with Inkscape. ;-)
###
Comments