Picture specified color replacement
🎨 Pictures and replacement settings
The color value obtained - | Replace pixels 0
💡 Instructions for use
- Click on the picture to pick the color, and the value will be automatically filled in the target color column, which is closer to the real pixels than filling in by hand.
- The tolerance starts from 0 and gradually increases: if there is a missing change, add a little, and the edge of the main body starts to change color, then go back, rather close to the lower limit.
- It is recommended to keep light and dark in photos and gradient images. Flat icons and solid color blocks can be changed to solid color filling for a cleaner result.
- Transparent pixels will be automatically skipped, and images with transparency will remain in PNG format when exported to prevent transparent areas from being filled with a white background.
Click to pick the color, and then decide how wide the range should be.
How does substitution happen?
The program reads the color pixel by pixel and replaces the pixels that are within a tolerance of the target color with the new color, leaving the rest unchanged. Therefore, whether the replacement result is clean depends on two things: whether the target color is obtained accurately and whether the tolerance is appropriately placed, rather than how complex the algorithm is. Understanding this can help you quickly determine where the problem lies.
How to choose the target color most accurately
The easiest way is to click directly on the picture. What you read is the true value of the pixel there, which can avoid the deviation of the color value estimated by the naked eye. If the image is compressed, there are actually multiple similar but different pixel values in the same area. At this time, you should compare a few more points and choose the one with the most occurrences as the target color, and add a little tolerance when replacing.
Adjust tolerance from small to large
Starting from scratch gives you the strictest result: only identical pixels are replaced. If you find that there is no change in the target area, it means that the color of the area itself fluctuates. Gradually increasing the tolerance to ten to thirty can usually cover it. When the edge of the main body begins to change color, it indicates that it has been overdone. You should return to the previous acceptable value. There is no unified standard for this step.
What to do if there are holes in the replacement area
Holes mostly appear in solid color areas of photos: what appears to be one color is actually slightly different due to lighting and compression. In addition to increasing the tolerance, you can also change your thinking - first try out a tolerance value that can cover all fluctuations in a small local area, and then apply it to the entire picture. If the holes are concentrated on the edge, they are anti-aliased transition pixels, and the processing method is different from this paragraph.
When to change tools
If the target is not a certain color, but you want to adjust the entire picture to the same tone, using color replacement will be very awkward: you need to repeatedly pick the color and process it block by block. That kind of scene belongs to the overall color grading, and you should use filters or hue adjustments instead. The judgment criteria is simple - are you dealing with a few specific colors or the overall mood of the entire image?
If there are holes in the target area, it means that the color itself fluctuates: test the tolerance first and then apply it to the entire image. Do not pick the color repeatedly.
📖 Glossary
- target color
- The color to be replaced. You can click to select a color from the picture, or enter the color value directly. The more accurate the selection, the smaller the tolerance required and the cleaner the edge after replacement.
- Tolerance
- Determine the leniency and severity of "whether it counts as the same color". When the tolerance is 0, only identical pixels are replaced. A slightly larger adjustment can cover similar shade changes. However, if it is adjusted too large, it may accidentally damage the surrounding colors. You need to watch and experiment.
- color value representation
- Different ways of writing the same color: Hexadecimal compresses red, green, and blue into six characters, suitable for copying and pasting; the three-component integer writing method is convenient for adjusting a channel independently; the writing method of hue, saturation, and brightness is closer to human intuition, and is most convenient when brightening or darkening.
- Pick color
- Click directly on the picture to read the color of the pixel there as the target color. Compared with guessing the color value with the naked eye, color selection can avoid deviations caused by display differences, and is the most trouble-free method when replacing backgrounds or solid color blocks.
- Preserve light and dark
- When replacing colors, the original shade changes are retained: the bright areas are still lighter and the dark areas are still darker, but the hue is changed. It's important to use it on photos with light, shadow, and gradients. Turning it off will turn the entire area into a rigid solid color.
- edge transition
- The junction between the replaced area and the rest of the original image. If there is an intermediate color produced by anti-aliasing near the target color, a circle of noise that has not been replaced will appear at the interface. The common solution is to increase the tolerance appropriately, or to enlarge the image before processing.
- Miscellaneous
- The narrow band of heterochromatic color remaining at the junction of the old and new colors after replacement. It mostly appears on anti-aliased graphics such as text strokes and icon outlines, because those pixels are a mixture of two colors, and the distance from the target color is just outside the tolerance.
- transparent pixels
- Pixels that have no color information of their own. It should be skipped during processing, otherwise the originally transparent area will be painted in solid color, and an extra background will appear immediately after saving, making it look like a color block has been added to the image.
- Background color replacement
- Changing the solid color background to another color is often used to adjust the background color of ID photos and product images. Solid color backgrounds are the easiest to work with: pick the color once, adjust the tolerance slightly, and you can cleanly replace it with little impact on the subject.
- Logo color change
- Change a certain color in an icon or logo to adapt to the color matching specifications of different brands. It should be noted that logos often have gradients and strokes. If the tolerance is too large, the gradient will be eaten away. It is recommended to test the color in a small area before applying it to the entire image.
- Batch replacement
- Apply the same set of color pick and tolerance settings to multiple images. It is suitable for product pictures or materials with a unified style. Manual adjustment one by one is time-consuming and prone to inconsistencies. Only batch processing with fixed parameters can ensure neat results.
- Comparison before and after replacement
- Observe the processed results side by side with the original image or switch repeatedly to see whether the edges, gradients and shadows are natural. It is easy to miss the edges by just looking at the thumbnails. It is safer to enlarge to the original size and check it before saving.
🔗 All keywords and tutorials
❓ FAQ
- Will pictures be uploaded??
- No. Reading, replacing and exporting are all completed locally in the browser, and no upload request is initiated.
- How to choose color?
- After selecting the picture, click on it to read the pixel color there as the target color.
- What is tolerance?
- Determine whether the colors are similar in width and severity. The larger the color, the wider the coverage, and the easier it is to cause accidental damage.
- Can the gradient be preserved??
- Yes. After turning on Preserve Light and Dark, only the hue is changed, and the relationship between depth and gradient remains the same.
- Will transparent images become dirty??
- No. Completely transparent pixels will be skipped and no new color blocks will appear after replacement.
- Can I download the results??
- Yes. After the replacement is completed, click Download to save it as PNG, and the original image will not be affected.