Category Archives: image processing

Draw an image spiral in C#

This example lets you draw image spirals similar to the one shown above. This example lets you draw image spirals similar to the one shown above. It’s mostly just for fun, although it does include a useful exercise in graphics … Continue reading

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

Crop images to specific sizes in C#

Sometimes I need to crop images to specific sizes or aspect ratios. For example, the following list shows some recommended image sizes for Google Business. Profile image – 250×250 pixels Cover photo – 1080×608 pixels Shared images – 497×373 pixels … Continue reading

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

Draw on top of a background image in C#

Drawing on a background image is actually very easy. It seems to be a common question on the internet, however, so I decided to make this example. This example draws on a background image in two ways. If you just … Continue reading

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

Make a Pinterest-style diagonal picture montage in C#

This example was inspired by a picture montage generated by Pinterest. Several months ago, my girlfriend and I started a bakery (see the website here), and a cool image appeared on our Pinterest page (which is here). Pinterest had taken … Continue reading

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

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 , , , , , , , , , | 2 Comments

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