Wednesday, January 7, 2009

Download Adobe Air for Linux

Adobe Air Linux edition is released. You can download it from here. Some ideas about it ;

As of today there have only been releases of Adobe AIR for Windows and Mac but Adobe is committed to also delivering a version for Linux. This is great news for developers like me who use Linux as their primary desktop operating system.

Adobe CTO Kevin Lynch said in a statement: “This could enable a whole new frontier of applications for Linux. We’re actually looking for Linux users to help us test it.” He said that the Linux version of AIR is currently in an alpha format.

AdobeAIR Alpha on Ubuntu 64 Bit installation can be found here.

I'm very excited with this news. Thanks to Adobe... :)

"Linux lovers do not see below .net codes. I'm also a mac and linux lover but nowadays using .net in a project :("

Image Processing II : Two Ways for Grayscale

There may be many ways to process grayscale but I want to give two examples for it. One of them is very easy like taking average of colors. And the other one is better but uses color matrix. You must define a color matrix to use as image attribute. I like the second algorithm. Anyway, Let's see codes...

'--------------------Code--------------------
Public Shared Function GrayscaleAverage(ByVal img As Image) As Image
Dim rslt As System.Drawing.Image
Dim btmpImg, btmpRslt As New Bitmap(img.Width, img.Height)
btmpImg = DirectCast(img, Bitmap)
btmpRslt = DirectCast(img, Bitmap)
Dim rC, gC, bC, lum As Integer
For i As Integer = 0 To btmpImg.Width - 1
For j As Integer = 0 To btmpImg.Height - 1
rC = btmpImg.GetPixel(i, j).R
gC = btmpImg.GetPixel(i, j).G
bC = btmpImg.GetPixel(i, j).B
lum = Math.Round(0.3 * rC + 0.59 * gC + 0.11 * bC)
btmpRslt.SetPixel(i, j, Color.FromArgb(lum, lum, lum))
Next
Next
rslt = DirectCast(btmpRslt, Image)
Return rslt
End Function
'--------------------Code--------------------


Second function realized with color matrix. You can use another color matrix. may b

'--------------------Code--------------------
Public Shared Function GrayscaleMatrix(ByVal img As Image) As Image
Dim rslt As System.Drawing.Image
Dim btmpImg As New Bitmap(img.Width, img.Height)
btmpImg = DirectCast(img, Bitmap)
Dim g As Graphics = Graphics.FromImage(btmpImg)
Dim cm As ColorMatrix = New ColorMatrix(New Single()() _
{New Single() {0.5, 0.5, 0.5, 0, 0}, _
New Single() {0.5, 0.5, 0.5, 0, 0}, _
New Single() {0.5, 0.5, 0.5, 0, 0}, _
New Single() {0, 0, 0, 1, 0}, _
New Single() {0, 0, 0, 0, 1}})
'You can use other color matrix

Dim ia As ImageAttributes = New ImageAttributes()
ia.SetColorMatrix(cm)
g.DrawImage(img, New Rectangle(0, 0, img.Width, img.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, ia)
g.Dispose()
rslt = DirectCast(btmpImg, Image)
Return rslt
End Function
'--------------------Code--------------------



Also we can see the difference between two algorithms here.

image taken from here

The other color matrix is here.

'--------------------Code--------------------
'Gilles Khouzams
Dim cm As ColorMatrix = New ColorMatrix(New Single()() _
{New Single() {0.3, 0.3, 0.3, 0, 0}, _
New Single() {0.59, 0.59, 0.59, 0, 0}, _
New Single() {0.11, 0.11, 0.11, 0, 0}, _
New Single() {0, 0, 0, 1, 0}, _
New Single() {0, 0, 0, 0, 1}})
'--------------------Code--------------------


I will continue with edge finding and background extraction. Like Photoshop, isn't it?

Friday, January 2, 2009

Image Processing I : Invert Colors

Hi all,

I'm starting with a basic image processing algorithm. After a while, the whole solution and sample files will be published. I'm also developing this library and sharing with you. Anyway, you can see the algorithm below. All basic colors are converted by subtracting from 255 and founded new Red, Green and Blue color codes. All converted pixel is set to a new image instance. See you at harder image processing algorithms later. Let's See;


'--------------------Code
--------------------
Public Shared Function InvertColors(ByVal img As Image) As Image
Dim rslt As System.Drawing.Image
Dim btmpImg, btmpRslt As New Bitmap(img.Width, img.Height)
btmpImg = DirectCast(img, Bitmap)
Dim rC, gC, bC As Integer
For i As Integer = 0 To btmpImg.Width - 1
For j As Integer = 0 To btmpImg.Height - 1
rC = 255 - btmpImg.GetPixel(i, j).R
gC = 255 - btmpImg.GetPixel(i, j).G
bC = 255 - btmpImg.GetPixel(i, j).B
btmpRslt.SetPixel(i, j, Color.FromArgb(rC, gC, bC))
Next
Next
rslt = DirectCast(btmpRslt, Image)
Return rslt
End Function

'--------------------Code--------------------

Monday, December 1, 2008

Image Processing Articles

I'll write about image processing by writing classes with Visual Studio .Net 2008. As I've seen in Photoshop, there are lots of processing algorithms. Firstly, I'll realize basic algorithms like inverting, boundary edge finding.

If you have any source, I'll be appreciated to add to be formed class. Genius ideas are also welcome.

Thursday, September 25, 2008

Adobe is Announcing Adobe Creative Suite 4

"With industry-standard tools, the new Adobe® Creative Suite® 4 is everything you need to help your students better express their ideas in video, on the web, or in print. Adobe CS4’s new creative and online collaboration features will better prepare your students for both future academic success and today’s competitive, fast-moving workforce. Introduce your students to CS4 and watch as everyone finds their own shortcut to brillant."

For detailed information click here