How to Bake Blender Vertex Colors into an Image for Material ID Masks
To bake vertex colors into a material ID image, read the mesh’s color attribute in its material, connect it to an Emission shader, and bake the Emit pass in Cycles to an active Image Texture node. The mesh needs a UV map, and the destination image must be selected in that node. Blender documents these requirements in its Render Baking guide.
This workflow is for an artist who already has—or wants to assign—flat color regions on one mesh and needs a reusable texture for selecting those regions during texturing. The instructions use Blender 4.5 LTS terminology and cover baking onto the same mesh.
1. Decide which regions need separate IDs
An ID texture uses distinct colors to label surface regions. For an illustrative desk organizer, assign red to the outer shell, green to the inset tray, and blue to the feet. Those colors identify selections; the finished materials can have entirely different appearances.
Start with a small palette whose colors are easy to distinguish. For this three-region example, use RGB values (1, 0, 0), (0, 1, 0), and (0, 0, 1), with opaque alpha. Keeping the channels at their endpoints also makes the exported image easier to check numerically.
Decide whether disconnected pieces should share a selection. All four feet can use blue if they will receive the same treatment. Give them different IDs only when you need to select them independently. Record the mapping before painting so that the image remains understandable later.
2. Prepare a color attribute with sharp boundaries
Select the mesh and open Object Data Properties > Color Attributes. Identify the layer containing your colors, or create one named Material_ID. Blender supports both Vertex and Face Corner domains: the former stores a color per vertex, while the latter stores a color per face corner. The manual specifically describes face-corner painting as useful for sharp color edges on low-poly assets. See Object Data: Color Attributes.
For adjoining faces that need different IDs, choose Face Corner. A shared vertex can then have different colors on its neighboring faces. Fill every corner of each intended face with the same ID color; different corner colors within a face can produce a gradient across it.
In Vertex Paint mode, enable face selection masking, select one region, choose its color, and use Paint > Set Vertex Colors. Repeat for each region. Blender documents that command as filling the active color attribute with the current paint color. Use its Affect Alpha option when you want the assigned colors completely opaque. See Editing Vertex Paint Colors.
Inspect the source before baking. On the organizer, the shell should be uniformly red right up to the tray boundary, where it changes directly to green. If the source already has a broad blend, correct the assignments first. Increasing image resolution will only reproduce that blend with more pixels. Likewise, converting an existing attribute to Face Corner does not reconstruct missing flat-color assignments; repaint the affected faces.
3. Prepare UVs and a destination image
The image bake needs UV coordinates. Inspect the mesh’s UV layout and use the UV map intended for the exported texture. Blender describes UV maps as the mapping between a 3D surface and a 2D image in its Object Data documentation.
For this workflow, keep islands inside the ordinary 0–1 tile. Avoid overlapping surfaces with different IDs: one image location cannot reliably represent both red shell pixels and green tray pixels. Stacked UVs are appropriate only where the overlapping surfaces intentionally need identical texture content.
Create a blank image named Organizer_ID in the Image Editor or through an Image Texture node. An illustrative starting size is 2048 × 2048; choose the actual resolution by inspecting the smallest region you must select. A narrow foot occupying only a few pixels needs more UV space or greater image resolution.
Treat the destination as data by setting its color space to Non-Color before baking. Blender recommends this setting for images whose values should bypass color conversion, including stencil maps. See Image Settings. Use the same data interpretation when reopening the exported ID image.
4. Route the attribute through an Emission shader
Preserve your existing material setup before changing its output. In the Shader Editor, add a Color Attribute node and explicitly select Material_ID. Its dropdown lists attributes from the active mesh; a red attribute field indicates that the named attribute is unavailable on that mesh. See the Color Attribute Node documentation.
Add an Emission shader and make these connections:
Color Attribute: Color→Emission: Color.- Set
Emission: Strengthto1. Emission→Material Output: Surface.
This makes the attribute color the material’s emission input. Baking Emit then extracts that emission pass, as defined in Blender’s Render Baking documentation. It provides a direct route for the ID colors without adding the scene’s surface lighting.
Add an Image Texture node, choose Organizer_ID, and leave it disconnected during baking. Click it last so it becomes the active node. This node is the destination; the Color Attribute node supplies the source. Merely displaying the image in the Image Editor does not establish the material’s bake target.
If the mesh uses several assigned materials, repeat the emission setup and destination-node selection in each material used by its faces. Point every destination node to the same Organizer_ID image. Blender uses the active Image Texture node as the image target, so check each material before starting the bake.
5. Bake the image with deliberate padding
Return to Object Mode, select only the intended mesh, and set the render engine to Cycles. Open Render Properties > Bake and configure:
| Setting | Value for this workflow |
|---|---|
| Bake Type | Emit |
| Target | Image Textures |
| Selected to Active | Off |
| Clear Image | On for the initial complete bake |
| Margin Type | Extend |
| Margin Size | Start with 8 px, then inspect |
These controls, including the distinction between image and color-attribute targets, are documented in Render Baking.
Click Bake, then display Organizer_ID in the Image Editor. Expect flat color patches arranged according to the UV islands, with padding around their borders.
The 8 px margin is a starting example, not a universal requirement. Blender’s Extend mode expands border pixels outward, and margins help avoid seam discontinuities caused by filtering and mipmaps. Leave enough space between islands for the padding. As a conservative layout check, two independently padded borders using eight pixels each call for more than sixteen pixels of separation if their padding must remain apart.
Keep Selected to Active off because the source colors and destination UVs belong to the same mesh. Transferring colors from another object introduces projection settings and requires a separate setup. Also keep Clear Image enabled when replacing the entire image; disable it only for a deliberate staged bake that must retain previously baked regions.
6. Save the texture without a render appearance transform
In the Image Editor, use Image > Save As to write the baked texture to disk. Blender documents image saving separately from packing images into a blend file in Editing Images.
For the three-color example, choose PNG, RGB, and 8-bit color depth. Keep Save As Render disabled: Blender documents that this option applies render color management, including view and display transforms for PNG. Those transforms are unnecessary for this data texture. See Supported Graphics Formats.
RGB is sufficient when you only need the three ID channels. Use RGBA only if your receiving workflow needs alpha, and inspect that channel separately. Save the blend file as well so the attribute, UVs, and bake setup remain available for revisions.
7. Verify the saved file on the mesh
Reopen the exported PNG as a separate image and set its color space to Non-Color. Temporarily connect that image’s Color output through the Emission shader, keeping strength at 1. Use the same UV map used for the bake.
For this inspection, set Image Texture interpolation to Closest. Blender defines it as nearest-neighbor sampling with no interpolation, which makes individual texture pixels easier to judge. This is a playback setting; it does not remove blended pixels already stored in the image. See Image Texture Node.
Check three kinds of locations:
- Region interiors: shell, tray, and feet should each contain their intended uniform color. In the saved eight-bit RGB example, interior samples should read red
(255, 0, 0), green(0, 255, 0), or blue(0, 0, 255). - ID boundaries: inspect where red meets green. A broad gradient calls for checking the source attribute; a narrow mixed edge calls for checking baked pixels and sampling.
- UV seams and small parts: inspect island borders and the smallest feet. Look for background slivers, neighboring colors, or regions too small to select reliably.
Finally, load the saved image into the intended texturing workflow and select the tray’s green ID. The practical acceptance check is that the selection covers the tray, preserves its small details, and leaves the shell and feet unselected. Exact color matching can leave gaps at mixed boundary pixels, so inspect the receiving tool’s tolerance behavior instead of assuming every edge pixel equals an interior palette value.
8. Diagnose the result before rebaking
Use the visible symptom to choose your next check. The following sequence is a diagnostic aid derived from the attribute, image-target, and sampling behavior documented above.
| Symptom | First check | Next action |
|---|---|---|
| Blank image or missing regions | Active destination node in every assigned material | Select the correct image node and rebake |
| Entire mesh has one unexpected color | Attribute selected in the source node | Choose the intended layer and inspect its assignments |
| Broad gradients cross faces | Source corner colors | Refill each ID region uniformly |
| Wrong colors appear on unrelated parts | UV overlap | Separate surfaces requiring different IDs |
| Thin borders show background | Padding and island spacing | Adjust margin or packing, then rebake |
| Saved image behaves differently from the bake | Color interpretation and export settings | Reopen as data and check Save As Render |
| Small regions disappear | UV size at output resolution | Enlarge their islands or increase resolution |
Once the saved image passes the selection check, restore the mesh’s original material output. Keep the ID palette and source attribute with the project so later geometry changes can be rebaked consistently. The useful deliverable is a saved texture whose regions remain distinct and selectable at the resolution where you will use it.
Sources
- Render Baking — Blender 4.5 LTS Manual
- Object Data — Blender 4.5 LTS Manual
- Editing Vertex Paint Colors — Blender 4.5 LTS Manual
- Color Attribute Node — Blender 4.5 LTS Manual
- Image Settings — Blender 4.5 LTS Manual
- Image Texture Node — Blender 4.5 LTS Manual
- Editing Images — Blender 4.5 LTS Manual
- Supported Graphics Formats — Blender 4.5 LTS Manual