Home > Tutorials > Image Processing – Emboss Effect

Image Processing – Emboss Effect


A cool, nice effect 🙂

Applied from Convolution Matrix concept with the following matrix:

[ -1 | 0 | -1 ]

[ 0 | 4 | 0 ]

[ -1 | 0 | -1 ]

The factor is 1 and offset is 127.

Got these results:

Original Image

Original Image

Applied Emboss Effect

Applied Emboss Effect

This is the implementation (the same old one used for Convolution Matrix on my articles, lol)

	public static Bitmap emboss(Bitmap src) {
		double[][] EmbossConfig = new double[][] {
			{ -1 ,  0, -1 },
			{  0 ,  4,  0 },
			{ -1 ,  0, -1 }
		};
		ConvolutionMatrix convMatrix = new ConvolutionMatrix(3);
		convMatrix.applyConfig(EmbossConfig);
		convMatrix.Factor = 1;
		convMatrix.Offset = 127;
		return ConvolutionMatrix.computeConvolution3x3(src, convMatrix);
	}

A cool effect, isn’t it?
Hope you like it!

Cheers,
Pete Houston

Advertisements
  1. Sumit
    March 11, 2013 at 12:31 am

    i am not getting the concept behind taking the offset value…please tell me in detail what logic behind to take offset..

  2. November 15, 2011 at 7:48 pm

    Hey its taking hell of a time… is it ok???? my mobile is HTC Desire HD having 1 G processor

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: