on-internet
← Community

Applying relief (emboss) effect to bitmap using GetPixel/SetPixel in C# WinForms

Stack Overflow ·

I am trying to apply a simple relief (emboss-like) effect to an image in a WinForms application using Bitmap.GetPixel and SetPixel. The idea is to compare the brightness of the current pixel with a shifted pixel (offset by 5 pixels) and compute a new grayscale value. Here is my code: public static void ApplyReliefEffect(Form form) { if (ImageStorage.bitmap != null) { int brightness; int brightness1; int brightness2; Bitmap sourceBitmap = new Bitmap(ImageStorage.bitmap); Bitmap offsetBitmap = new Bitmap(ImageStorage.bitmap); Color currentPixel; Color offsetPixel; Graphics graphics = form.Create

Comments

Sign in or sign up to comment and upvote.

No comments yet.