What the Top Line Fill tool does

The Top Line Fill tool in Photoshop fills the topmost visible pixels in a selection or layer with a chosen color. It works by scanning from the top of your image downward and stopping at the first non-transparent pixel it encounters, then filling that pixel and any adjacent pixels of the same color value upward to the edge of the canvas or selection. This is useful when you have a shape or object with an open top and want to flood-fill it without accidentally coloring areas outside your intended boundary.

The tool sits in Photoshop's fill toolset alongside the Bucket Fill and Content-Aware Fill options. Unlike the standard Bucket Fill, which fills based on color similarity and tolerance, Top Line Fill respects the topmost boundary of your content, making it predictable for structured designs where you need precision.

Key Takeaways

  • Top Line Fill scans from the top of your image downward and fills from the first visible pixel it finds, useful for shapes with defined upper edges.
  • You set the fill color in the foreground color swatch before using the tool, and adjust tolerance in the tool options to control how similar nearby colors must be to fill.
  • The tool works on layers with transparency and respects layer masks, so it will not fill areas hidden by a mask.
  • Top Line Fill is most effective on images with clear boundaries between the area you want filled and the area you want to protect.

Setting your foreground color before filling

Before you use Top Line Fill, click the foreground color swatch in the toolbox (the larger square in the overlapping color squares on the left side of your screen). This opens the color picker. Choose the color you want to fill with, then click OK to close the picker. The foreground color swatch now shows your chosen color and will be the color Top Line Fill uses.

If you want to fill with a color already present in your image, use the eyedropper tool to sample it. Hold Alt (Windows) or Option (Mac) while the Top Line Fill tool is active, then click on the color in your image. The foreground color updates to match.

Selecting the Top Line Fill tool and adjusting tolerance

Open the Tools panel on the left side of Photoshop. The Top Line Fill tool is grouped with the Bucket Fill tool. Click and hold on the Bucket Fill icon (it looks like a paint bucket) until a menu appears, then select Top Line Fill from the list. The tool is now active.

In the tool options bar at the top of the screen, you will see a Tolerance slider. Tolerance controls how similar a pixel's color must be to the pixel you click on in order to be filled. A low tolerance (around 10–20) fills only very similar colors and is useful when you want to fill a specific area without spreading to nearby colors. A high tolerance (50–100) fills a broader range of colors and is useful when your target area has slight color variation. Start at 50 and adjust based on your results.

Clicking to fill from the top boundary

Once your foreground color is set and tolerance is adjusted, click anywhere within the area you want to fill. Top Line Fill scans upward from that point to find the topmost visible pixel, then fills downward from there. If your shape has a clear top edge, the fill will stop at that boundary and not spread into surrounding areas.

If the fill spreads further than you intended, undo the action (Ctrl+Z on Windows, Command+Z on Mac), lower the tolerance, and try again. If the fill does not reach all the areas you expected, raise the tolerance slightly and click again.

Using Top Line Fill with selections and masks

You can restrict Top Line Fill to a specific area by creating a selection first. Draw a selection using the Rectangle Select, Ellipse Select, or Free Select tool, then use Top Line Fill within that selection. The fill will not extend beyond the selection boundary, giving you precise control over where color is applied.

If your layer has a layer mask, Top Line Fill respects the mask and will not fill areas that the mask hides. This is useful when you want to fill only the visible portions of a layer. To fill areas hidden by the mask, you must temporarily disable or delete the mask, fill, then reapply the mask if needed.

Common reasons Top Line Fill does not work as expected

If Top Line Fill does not fill anything when you click, check that your layer is not locked. A locked layer prevents any edits. Click the lock icon next to the layer name in the Layers panel to unlock it. Also verify that the layer has an alpha channel (transparency support). Some layers, like flattened backgrounds, do not support transparency and may behave differently.

If the fill spreads into areas you want to protect, the tolerance is too high. Lower it and try again. If the fill stops short of where you expected, the color variation in your target area may be greater than the tolerance allows. Raise the tolerance or use the eyedropper to sample a color from the area you are trying to fill, which can improve results.

Frequently Asked Questions

Can I undo a Top Line Fill if I make a mistake?

Yes. Press Ctrl+Z (Windows) or Command+Z (Mac) immediately after filling to undo the last action. You can undo multiple steps by pressing the shortcut repeatedly or by clicking Edit > Undo in the menu. If you have already performed other actions since the fill, use the History panel to step back to the state before the fill.

What is the difference between Top Line Fill and Bucket Fill?

Bucket Fill expands outward from the point you click, filling all connected pixels of similar color regardless of direction. Top Line Fill scans from the top of the image downward to find the topmost boundary, then fills from there. Top Line Fill is more predictable for shapes with defined upper edges, while Bucket Fill is better for filling irregular shapes or areas where direction does not matter.

Does Top Line Fill work on text layers?

Top Line Fill works on text layers only if you first rasterize the text layer, which converts it from editable text to pixels. Right-click the text layer and select Rasterize Layer, then use Top Line Fill as normal. After rasterizing, you can no longer edit the text content, so make sure your text is final before converting.

Can I fill with a pattern instead of a solid color?

Top Line Fill fills with the foreground color only, not patterns. To fill with a pattern, use the Bucket Fill tool instead and enable the Pattern option in the tool options bar. Then select your pattern from the pattern picker and click to fill.