Category Archives: image processing

Give an image an improved transparent background in C#

This example lets you make some pixels in an image part of a transparent background. Use the File menu to open an image file. When you click on the original image on the left, the program converts pixels that have … Continue reading

Posted in algorithms, graphics, image processing | Tagged , , , , , , , , , , , | Leave a comment

Make an image with rounded corners and a transparent background in C#

Recently I wanted to make an image for a gift card that had rounded corners. Unfortunately the Graphics class does not have a method to draw rectangles with rounded corners. Fortunately, I have already described the key method in my … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , | Leave a comment

Add a watermark to all of the files in a directory in C#

I recently wanted to make a slide show where each picture displayed a logo or watermark. File Explorer can easily play a slide show. Simply follow these steps: Browse to the folder containing the images. Click one of the image … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , | Leave a comment

Resize images in C#

You can use MS Paint to easily resize images. Unfortunately, it won’t preserve transparency if you save the result. I often need to resize transparent images so I finally got around to writing this example. It lets you resize images … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , , | 4 Comments

Combine image slices in C#

After my recent post Adjust an image’s opacity in C#, I realized that it might be interesting to combine slices from different versions of an image saved with different opacities. I did’t really need to do this; it just seemed … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , | Leave a comment

Adjust an image’s opacity in C#

I recently wanted to reduce an image’s contrast by adjusting its opacity. If you draw a semi-transparent image on top of a white background, the result looks washed out so it can act as a background for text or whatever. … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , | 2 Comments

Make an image containing shadowed text in WPF and C#

Recently I wanted an image containing shadowed text similar to the following to put on my new Favorite Books page. It’s fairly easy to make this kind of text in Microsoft Word and then save an image of it in … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , | Leave a comment

Use transparency when drawing with anti-aliasing in C#

Anti-aliasing makes drawn lines look smoother on a raster image such as a bitmap or on the screen. Transparency allows you to place an image on top of another image so parts of the underlying image show through. Unfortunately, when … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , | 1 Comment

Make a picture with a transparent hole in it in C#

The example Create oval images in C# shows how to make a transparent image with an oval-shaped picture in it. This example shows how to do the converse: it makes an image with a transparent hole in the middle of … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , , | Leave a comment

Create sized oval images in C#

Almost as soon as I had finished the example Create oval images in C#, I realized that it wouldn’t work for my purposes. I wanted to make oval images for several people. Unfortunately, that program didn’t let you make images … Continue reading

Posted in drawing, image processing | Tagged , , , , , , , , , , , | Leave a comment