How to Draw & Paint a Galaxy Afro Portrait in Adobe Photoshop

Post pobrano z: How to Draw & Paint a Galaxy Afro Portrait in Adobe Photoshop

Final product image
What You’ll Be Creating

Afros are beautiful—and so is space! Let’s put them together in this galaxy-inspired portrait tutorial for Adobe Photoshop.

In this tutorial, we’re going to draw in Adobe Photoshop, from start to finish. You should have a basic understanding of Photoshop—for example, creating new documents, selecting content, and creating new layers should be familiar to you.

Looking for Photoshop resources? Why not pop over to GraphicRiver for Photoshop Brushes and more!

1. How to Create the Sketch

Step 1

First, start by creating a New Document. For this illustration, I’m going to work at 8 inches by 10 inches, at 300 dpi. 

Image of New Document Window

Step 2

When sketching, I always draw on a New Layer—separate from the Background. This helps keep these two aspects independent.  

Start with basic shapes to help establish your subject. I like to use Photoshop’s basic Hard Round Brush when drawing my initial sketches. 

Note the variable transparency in my lines—this is because my Opacity Jitter and Flow Jitter are set to Pen Pressure. You can find these settings in your Brush panel (located under Windows > Brush), and we will discuss them further, after creating a Custom Brush, in this tutorial.

Example of Initial Sketch

Step 3

I often like to draw on top of my initial sketch, using it as a guide—on a New Layer

When drawing afro textured hair, I like to focus on soft, round shapes. No two afros are exactly the same, so looking at reference is a strong idea! In this case, I wanted the hair to have some weight, as well as thickness.

Example of Refined Sketch

2. How to Create a Custom Brush

Step 1

Before we get too far into this illustration, let’s take a look at our Brushes

I often use Photoshop’s default Brushes when I draw and paint, but for this illustration, I’d like to use a Custom Brush. I could probably get away with using a Soft Round Brush for the afro, but I know I’m going to want a little extra texture in there. So let’s create a basic textured brush together.

Please keep in mind that creating Custom Brushes is potentially a tutorial all its own. There is a lot that can be done and customized! 

First, we’ll need to create a second New Document. I chose to work at 100 pixels wide by 100 pixels high.

Then, create a black circle on a New Layer. I used the Ellipse Tool to do so (hold down the Shift key while using the Ellipse Tool to create a perfect circle). 

Then I chose Rasterize Layer so it would no longer be a vector-based Layer. To do this, Right Click and select Rasterize Layer.

Example illustrating how to Rasterize a Layer

Step 2

Now, we need to add some texture to our circle. First, make sure to Lock Transparent Pixels in your Layers panel, so the Filters we apply stay within the circle. I applied both the Sponge and Film Grain Filters via the Filters Gallery to add some texture (you can find these via Filter > Filter Gallery). 

Example of applied Filter and Locking Transparent Pixels

Step 3

Next, I adjusted the Exposure (found via Image > Adjustments > Exposure) and hand drew some imperfections, both inside and around the circumference of the circle (remember to turn off Lock Transparent Pixels to do so, because we no longer want to stay inside the boundaries of our circle). 

My goal was to lighten the circle and make the primary contours look more organic (instead of a clean, perfect circle).

Example of modified circle

Step 4

Keep in mind that yours won’t look exactly like mine—and that’s fine! The goal is to create a brush with some texture and variation. 

Finally, apply a Gaussian Blur to the circle (I chose around 2.5%) and clean up any stray markings that you don’t want included in your Brush. You can find Gaussian Blur under Filters > Blur > Gaussian Blur.

Example of Blur applied to the circle

Step 5

To turn this circle into a Brush Preset, go to Edit > Define Brush Preset. You will then be prompted to give your Brush a name—any name will do! I normally choose a name that will help me remember what I created and/or what purpose I intended.

Example illustrating the creation of a Brush Preset

3. How to Add Initial Color and Values

Step 1

Now that we’ve created our Custom Brush, let’s go ahead and start working with color.

Personally, I like to apply base colors on top of my lines, in a New Layer with the Blending Mode set to Multiply

I chose a brown color, a little darker in value than the skin tone, as my base. For the eyes, accessories, and clothing, I decided to start with a purple color.

Example of initial Base Colors

Step 2

If you haven’t already, make sure to Save your work! I regularly Flatten my Layers when I’m painting; it’s a personal preference, but it’s also why I tend to save regularly and save multiple versions of my work. 

In this case, once I’m happy with my initial color choices, I Flatten my artwork Layers, keeping the Background independent.

I also chose a new Background Color via the Color Picker in the Tools panel. In this case, I know I want to go with something dark and space-like, so I chose a dark, cool gray.

Example with Background color added

Step 3

I’m happy with my color choices, but I decided I might like to give everything a purple hue, since the character is going to be set in space.

I created a New Layer and set the Blending Mode to Hue. Setting the Opacity to 32% gives it a slight hue, rather than an entirely purple hue. I used the same purple that I used in other parts of the illustration.

Example showing a purple hue added to illustration

Step 4

Now, let’s experiment with our light source.

Create a New Layer on top of your artwork Layers and set it to Clipping Mask (Right Click on the Layer and choose Clipping Mask from the available options). This way, when we apply color, it will be confined to the area the artwork occupies (we’ll automatically „stay in the lines”). 

I experimented with a light purple here, with the Layer’s Blending Mode set to Multiply.

Example of initial values added with Clipping Mask

Step 5

With my initial colors and values selected, it’s time to start blending and refining the artwork. 

When painting the face, I tend to stick to a Soft Round Brush, especially in the rounder parts of the face. When there’s a harsher shadow, I will often start with a Hard Round Brush and then blend using a Soft Round Brush

Some artists may prefer painting on top of their work on a New Layer—and this may be what you prefer, especially if you’re leery about making mistakes. 

Close up of illustration showing use of different Brushes

Step 6

In my opinion, it is very important to keep an eye on your Brush Settings. If you’re not getting the results you want with your Brush Strokes, adjusting these settings would likely be a step in the right direction.

For example, I almost always draw with the Opacity Jitter and Flow Jitter set to Pen PressureOpacity is generally the amount of transparency, and Flow can be considered how much color „comes out”. 

You can find these settings in your Brush panel (located under Windows > Brush).

Example of Brush Settings in the Brush Panel

Step 7

You can also experiment with the Opacity and Flow in your Options panel when you have the Paint Brush selected. 

So, for example, when I want a smooth transition on the face area, I might lower my Opacity and Flow considerably—versus when I’m drawing hard lines and I know I want a bold, hard contour.

Example illustrating soft and hard values in the illustration

Here is an example of overlapping Brush Strokes with varied Opacity and Flow, to further illustrate this concept in an isolated example.

Example Brush Strokes

Step 8

Personally, I like to add highlights and additional shadows later in my process, following the same techniques described. For example, for the eye area, I used a New Layer with a Blending Mode set to Multiply

Example showing additional value added

Step 9

Now let’s take what we’ve learned and apply this to our Custom Brush. We’re going to use it for my favorite part—the afro! 

I would recommend keeping the Brush Spacing between 5% to 10% for this Brush and the purpose of this tutorial. Again, you can open the Brush panel by going to Window > Brush.

Brush Spacing is the space between your Defined Brush. Remember the circle we created as the basis of our Custom Brush? Turn the Brush Spacing up high, and it’ll start to resemble the circle we originally created.

Example of Brush Spacing

However, we don’t want to draw a line of fuzzy circles—we want a relatively fluid stroke that has some texture to it. Here is an example of the texture we can create with this Custom Brush versus a standard Hard Round Brush.

Two Sample Circles drawn with different Brushes

Personally, when I’m painting afro textured hair, I like to apply color in a circular motion. I often think about clouds in terms of shape, as my guide. 

In progress example of painting the afro hair

4. How to Create Your Galaxy Background

Step 1

However, we’re not going for clouds in this tutorial—we’re going to work with galaxy colors! Now that I have the basics of my portrait figured out, I’m going to skip to the background. I want the background to feature similar, galaxy-inspired patterns and colors.

You may want to Hide your artwork Layer(s) so you can focus on the Background, for now. You can do this by toggling visibility on and off.

First, create a New Layer above the Background Layer and Fill it with black. This is going to be the start of our starry sky.

Example illustrating toggling Layers and creating new ones

Step 2

We’re going to apply a Filter to this New Layer. There are many ways you could approach this—the goal is simply to create a background full of stars. For this tutorial, we’re going to use the Sponge Filter in the Filter Gallery (found via Filters > Filter Gallery)

Example of the Filter Gallery and settings

Step 3

Next, apply a Gaussian Blur (found via Filter > Blur > Gaussian Blur). I chose to apply a radius of 3.5 pixels. 

Example of Gaussian Blur settings

Step 4

Then, we need to adjust the Curves. Go to Image > Adjustments > Curves, to open this panel. 

Our goal is to manipulate the Input points so they are close together. 

Example of Curves and Input values

Step 5

Next, let’s Create a New Layer, on top of the one we were just working on. We’re going to apply a Cloud Filter to this layer, using the colors black and white.

Set this Cloud Layer’s Blending Mode to Color Dodge

Example showing the new layer added with Cloud Filter set to Color Dodge

Step 6

Now, for the fun part! We need to create a New Layer between the Cloud Layer (set to Color Dodge) and the Star Layer (the one right above the Background Layer). Set this New Layer’s Opacity to 15%

Once you’ve created this Layer, take a Soft Round Brush and choose any color you’d like. I chose to start with a light blue color, because I know this is one I’d like in my galaxy. 

As you paint, you’ll notice it starts to look like clouds of color in the stars!  

Example that shows color added to the galaxy background

Step 7

You can add additional Layers of color here, if desired. Try adding different colors, using a Soft Round Brush. In this case, I stuck to blue, purple, and violet hues until I had pretty splashes of color.

It’s also a good idea to turn your Artwork layer back on, so you can get an idea of how your galaxy visually relates to the artwork. 

Artwork on top of the galaxy background

5. How to Paint Galaxy Colors in the Hair

Step 1

We’re going to apply these galaxy colors we’ve created to the hair, using a Clipping Mask and Blending Modes.

First, create a New Layer above your artwork and set it as a Clipping Mask (as described earlier in this tutorial). I like to use a Hard Round Brush to fill in the area I want to work with—in this case, the hair area.  

Color placed on top of the illustration in a Clipping Mask

Step 2

Once you’re happy with the area you’ve defined, set the Layer’s Blending Mode to Color. Make sure to toggle Lock Transparent Pixels on, so we are confined to the area we’ve just established when we’re drawing.

Now, using a Soft Round Brush, start applying colors inspired by the galaxy in the background. You’ll notice that it changes the color of the hair.

Example of Layers Blending Mode changed to Color

Step 3

At this point, I like to draw on top of my work and add small refinements. For example, using the same Custom Brush from earlier, I added some lighter blues and variations in the hair. 

Refinements added to the hair area of the illustration

6. How to Add Finishing Touches

Step 1

I also wanted to put sparkles in the hair, to push the galaxy aesthetic further. I started by drawing simple shapes—little dots and crosses—where I wanted to see stars.

Initial creation of hair sparkles

Step 2

Then, I Duplicated this Layer and added a Gaussian Blur to it, to give them a glow. 

Lower the Opacity of the original Layer to 20%, and then create a New Layer on top of both of the Layers of sparkles. I drew small dots in the center of each sparkle, on this Layer, to push them further.

Progress image of sparkles added to the hair area

Step 3

Finally, it’s time for some finishing touches. For the eyes and earrings, I used a Hard Round Brush to add some extra details and shine. My light source is coming from the viewer’s left, so I made sure to keep that in mind.

I also added a cute star shape to her cheek! Notice how it looks soft against the skin—this can be achieved by lowering the Opacity of the layer you’re drawing on.

I also thought a touch of galaxy-inspired eye shadow would help push things further! I did so using the same technique we used earlier, when adding colors to the hair. Create a New Layer, set the Blending Mode to Color, and add color using a Soft Round Brush. If the color seems too intense, try lowing the Opacity.

Close up of finishing touches added to the illustration

Step 4

One last thing and we’re done! Using a Soft Round Eraser, I removed some of the base of the artwork, so the character blends into the starry background.

Close up of the bottom of the portrait blended into the background

Awesome Work!

We’ve drawn a lovely, galaxy-themed portrait. As a woman of color with afro textured hair myself, I’d love to rock this look—but until I can get in touch with my inner space princess, painting this out-of-this-world style will have to do!

Good luck experimenting with your own galaxy-themed portraits!

Finished Galaxy Afro Portrait

Grid Level 2 and Subgrid

Post pobrano z: Grid Level 2 and Subgrid

I find the concept of subgrid a little hard to wrap my mind around.

I do understand the idea that we want to use nested semantic markup as we like and have elements participate in one grid so we don’t have to flatten our markup just for layout reasons. But that is largely handled by display: contents;.

Rachel Andrew explains it in a way that finally clicked for me:

I have an item spanning three column tracks of the grid, it is also a Grid Container with three column tracks – however these do not line up with the tracks of the parent…

If the nested grid columns were to be defined as a subgrid, we would use the subgrid value of grid-template-columns on that child element. The child would then use the three column tracks that it spanned, and its children would lay out on those tracks.

It’s not that the parent disappears, it’s that it shares grid lines with the parent so that getting internal elements to line up with everything else happens naturally.

Direct Link to ArticlePermalink

The post Grid Level 2 and Subgrid appeared first on CSS-Tricks.

Decorating lines of text with box-decoration-break

Post pobrano z: Decorating lines of text with box-decoration-break

An institution’s motto, an artist’s intro, a company’s tagline, a community’s principle, a service’s greeting… all of them have one thing in common: they’re one brief paragraph displayed on a website’s home page — or at least the about page!

It’s rare that just one word or one line of text welcomes you to a website. So, let’s look at some interesting ways we could style the lines of a paragraph.

To see how things currently are, let’s try giving borders to all the lines of some text in an inline span and see how it looks:

<p><span>Hummingbirds are birds from...</span></p>
span {
  border: 2px solid;
}

See the Pen Broken inline box. by Preethi (@rpsthecoder) on CodePen.

The edges appear broken, which they technically are, as the inline box has been fragmented into multiple lines. But we can fix those broken edges with box-decoration-break!

The box-decoration-break property in CSS can decorate the edges of fragments of a broken inline box (as well as of a page, column, and region boxes).

Its value, clone, does that with the same design that appears in the box’s unbroken edges, and its default value, slice, does not copy the decorations at the edges, keeping the break very visible like you saw in the demo above.

Let’s try it:

span {
  border: 2px solid;
  box-decoration-break: clone;
}

See the Pen Broken inline box w/ box-decoration-break. by Preethi (@rpsthecoder) on CodePen.

The property affects not only the border but also the shadow, spacing, and background of the broken edges.

Let’s play with the background first. While writing the post on knockout text, I was working with the background-clip property and wanted to see if the design held up for multiple lines of text. It didn’t.

The background gradient I applied was not replicated in every line, and after clipping it, only the first one was left with a background. That is, unless box-decoration-break: clone is added:

<p><span>Singapore:<br>Lion City</span></p>
span {
  background-image: linear-gradient(135deg, yellow, violet);
  background-clip: text;
  color: transparent;
  padding: .5em;
  box-decoration-break: clone;
}

See the Pen Gradient multi-line text w/box-decoration-break. by Preethi (@rpsthecoder) on CodePen.

The background-clip property with the text value clips a background to the shape of its foreground text. Since we used box-decoration-break, the gradient background is shown and clipped uniformly across all the lines of the text.

Going back to the border, let’s see how its shape and shadow can be copied across the broken edges, along with padding:

<img src="tree.png">
<p><span>Supertrees are tree-like structures...</span></p>
<img src="tree.png">
<p><span>Supertrees are tree-like structures...</span></p>
span {
  background: rgb(230,157,231);
  border-radius: 50% 0%;
  box-shadow: 0 0 6px rgb(41,185,82), 0 0 3px beige inset;
  padding: .5em 1.3em;
  box-decoration-break: clone;
}

p:nth-of-type(2) span {
  background-clip: content-box;
}

See the Pen Inline border shape & shadow w/box-decoration-break. by Preethi (@rpsthecoder) on CodePen.

In the second paragraph of the demo, the background is cropped until the content box (background-clip: content-box). As you can see, the crop happens in the broken edges as well, because of box-decoration-break: clone.

Another way we can style borders is with images. You might see a gradient border around the lines of text below, covering the broken edges, if the browser you’re now using supports border-image and the application of box-decoration-break over its result.

<p><span>The Malaysia–Singapore Second Link...</span></p>
span {
  border: 2px solid;
  border-image: linear-gradient(45deg, #eeb075, #2d4944) 1;
  background: #eef6f3;
  padding: .5em 1.3em;
  box-decoration-break: clone;
}

See the Pen Inline border image w/ box-decoration-break. by Preethi (@rpsthecoder) on CodePen.

An additional behavior we can tap into for decorating individual lines is of outline’s. In supported browsers, box-decoration-break can add an outline to every line of the text, including the broken edges, which is useful for creating bicolored dashed borders.

<p><span>Cloud Forest replicates...</span></p>
span {
  outline: 2px dashed rgb(216,255,248);
  box-shadow: 0 0 0 2px rgb(39,144,198);
  background: #fffede;
  padding: .5em 1.3em;
  animation: 1s animateBorder ease infinite;
  box-decoration-break: clone;
}

@keyframes animateBorder{
  to{
    outline-color: rgb(39,144,198);
    box-shadow: 0 0 0 2px rgb(216,255,248);
  }
}

See the Pen Inline outline w/ box-decoration-break. by Preethi (@rpsthecoder) on CodePen.

As observed in the demo, box-decoration-break withstands animation.

Besides borders and backgrounds, box-decoration-break can also manage shapes applied over elements. There is not much use for it in inline boxes, and is maybe better used in a column or page box, although the application is not yet widely supported in browsers.

But to show an example of what that does, let’s try applying the clip-path property to the span.

The property clip-path itself is only fully supported by Firefox, so only in it you might see an expected outcome. But following are two images: the results of applying a circular clip path over the span, without and with box-decoration-break.

span {
  clip-path: circle(50% at 202.1165px 69.5px);
  ...
}
A screenshot of a span of text being highlighted in DevTools showing that text is split up in three lines and with uneven start and end points.
Circular clip-path on a span
span {
  clip-path: circle(50% at 202.1165px 69.5px);
  box-decoration-break: clone;
  ...
}
A screenshot of a span of text being highlighted in DevTools showing that text is split up in three lines and with even start points but uneven end points.
Circular clip-path on a span with box-decoration-break: clone

You’ll notice in the first image that the 50% radius value is derived from the width of the inline box (the longest line) where box-decoration-break is not used.

The second image shows how box-decoration-break: clone redefines the computed value for 50% by basing them on the widths of the individual lines while keeping the center same as before.

And here’s how the inset function of clip-path (an inset rectangle) applied over the span clips it without and with box-decoration-break:

span {
  clip-path: inset(0);
  ...
}
A screenshot of a span of text being highlighted in DevTools showing that text is all on one line but the span continues for three lines with even start points but uneven end points.
Inset clip-path on a span
span {
  clip-path: inset(0);
  box-decoration-break: clone;
  ...
}
Inset clip-path on a span with box-decoration-break: clone

Without box-decoration-break, only a portion of the first line that matches the length of the shortest is visible, and with box-decoration-break: clone, the first line is fully visible while the rest of the box is clipped.

So, maybe if you ever want to show only the first line and hide the rest, this can come in handy. But, as I mentioned before, this application is more suitable for other types of boxes than ones that are inline. Either way, I wanted to show you how it works.

Browser Support

As we’ve seen here, box-decoraton-break can be super useful and opens up a lot of possibilities, like creating neat text effects. The property enjoys a lot support with the -webkit prefix, but is still in Working Draft at the time of this writing and lacks any support in Internet Explorer and Edge. Here’s where you can vote for Edge support.

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

Desktop

Chrome Opera Firefox IE Edge Safari
69* 11 32 No No TP*

Mobile / Tablet

iOS Safari Opera Mobile Opera Mini Android Android Chrome Android Firefox
11.3* 11 all 62* 66* 57

Wrapping Up

The box-decoration-break: clone copies any border, spatial, and background designs applied on a fragmented inline box’s unbroken edges to its broken ones. This creates an even design across all the lines of the text, decorating them uniformly and can be super useful for all those blurbs of text that we commonly use on websites.

The post Decorating lines of text with box-decoration-break appeared first on CSS-Tricks.