• 0

Anyone know the formula to get Sepia for an image


Question

I have an image and i would like to transform it into a sepia (old looking picutre) .... but i am not sure about the formula ...

i know that to get the greyscale picture (or b/w) i add the RGB then divide by 3 and set that value to the new RGB .... but for sepia i have no idea on how to do it ...

also on the same note, does anyone know how to make a picture look infra-red-ish ... basically give it a boost of green tint ? .. .thanks in advance

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

There's no one sepia color though.

Just experiment with values, make it greyscale, or modify the greyscale, so that after it's greycaled you remove some blu eand add in red and yellow for the brown color untill you get a good sepia.

Link to comment
Share on other sites

  • 0

Look for "Hue and Saturation" link under "image"

On the bottom right check colorize. Slide the top bar to a yellowish reddist then start taking away some of the saturation till you get the level you want.

Link to comment
Share on other sites

  • 0
I have an image and i would like to transform it into a sepia (old looking picutre) .... but i am not sure about the formula ...

i know that to get the greyscale picture (or b/w) i add the RGB then divide by 3 and set that value to the new RGB .... but for sepia i have no idea on how to do it ...

also on the same note, does anyone know how to make a picture look infra-red-ish ... basically give it a boost of green tint ? .. .thanks in advance

You will find the code to create a number of image processing filter on my web site

the one that shows you how to create a Sepia filter is located Here http://ess-image.com/Graphic/Image_Process...lor_Filter.aspx

Feel free to look around at the other code sample dealing with graphics

I hope this will help you

Link to comment
Share on other sites

  • 0

I clicked on this thread thiking you were asking for the chemical formula to turn black and white photos to sepia.

Man! That thing smells like rotten eggs.

Link to comment
Share on other sites

  • 0
Download the source code for Paint.NET, and look for SepiaEffect.cs. That should be enough to get you going.

That's been closed source for a while now.

Link to comment
Share on other sites

  • 0

In general, colour effects like the ones you seen in cameras and cell phones, like Sepia, is done by taking the image in YUV space and setting the UV channels for the entire image to a constant, while leaving Y unchanged. At least, that's how it's done in hardware.

Link to comment
Share on other sites

  • 0
Yup. I stopped using it when the author stopped releasing the source.

Here is a visual basic version if you want it. There are two functions the first set the color in the colormatrix the second function applies the colormatrix.

Public Function GetSepia() As Image

Dim cm As ColorMatrix

cm = New ColorMatrix(New Single()() { _

New Single() {0.393, 0.349, 0.272, 0, 0}, _

New Single() {0.769, 0.686, 0.534, 0, 0}, _

New Single() {0.189, 0.168, 0.131, 0, 0}, _

New Single() {0, 0, 0, 1, 0}, _

New Single() {0, 0, 0, 0, 1}})

Return draw_adjusted_image(cm)

End Function

Private Function draw_adjusted_image(ByVal MyImage as image, ByVal cm As ColorMatrix) As Image

Dim bm As Bitmap

Try

Dim image_attr As New ImageAttributes

Dim rect As Rectangle = Rectangle.Round(MyImage .GetBounds(GraphicsUnit.Pixel))

Dim width As Integer = MyImage .Width

Dim height As Integer = MyImage .Height

Dim gr As Graphics

bm = New Bitmap(wid, height)

gr = Graphics.FromImage(bm)

image_attr.SetColorMatrix(cm)

gr.DrawImage(m_StartingImage, rect, 0, 0, width, height, GraphicsUnit.Pixel, image_attr)

Return bm

gr.Dispose()

image_attr.Dispose()

image_attr = Nothing

Catch ex As Exception

'Place error handling code here

End Try

Return bm

End Function

I can write you a class if you want me to?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.