Grayscaling a bitonal image

Feature Requests for GdPicture.NET.
Post Reply
gcorgnet
Posts: 4
Joined: Thu Nov 29, 2007 9:59 pm

Grayscaling a bitonal image

Post by gcorgnet » Thu Nov 29, 2007 10:07 pm

Hi,

I have a set of bitonal images (TIFF). I would like to send them to the browser. For that, I can convert them into GIF (or PNG). I am using ASP.NET / C#.

This works properly with GDI+ (No need for your ActiveX control)

Now, what I would like to achieve is grayscaling those images on-the-fly so the look better in the browser. I know this is possible (a lot of software do it, for example Windows Picture & Fax Viewer)

Do you think this would be possible using GdPicture ?
I tried the SetGrayScale method but obviously this one is to grayscale colored images only ...

Any idea ?

Thanks

Guillaume

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Fri Nov 30, 2007 12:20 pm

Hi Guillaume,

You have many ways to do that with gdpicture.

I give you a simple one:

Code: Select all

Call Imaging1.ConvertTo24BppRGB
Call Imaging1.Imaging1.SetSoftenEffect(100)

Is this good for your need ?

Regards,

Loïc

gcorgnet
Posts: 4
Joined: Thu Nov 29, 2007 9:59 pm

Thanks Loic

Post by gcorgnet » Fri Nov 30, 2007 12:24 pm

I'll test that and let you know how it goes ...

Cheers


Guillaume

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Fri Nov 30, 2007 4:43 pm

Ok thanks.

In the next release i will add a ConvertBitonalToGrayScale() method in order to convert falstly bitonal images to gray scale images.


Loïc

gcorgnet
Posts: 4
Joined: Thu Nov 29, 2007 9:59 pm

It works

Post by gcorgnet » Sun Dec 02, 2007 8:10 pm

Hi Loic,

The solution you gave me works pretty well.

Converting to 24bp didn't give a perfect results (dots appearing on the document), but I tried converting to 8bppAdv and it looks pretty good.

Thanks a lot for that !

Guillaume

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Sun Dec 02, 2007 8:15 pm

Guillaume thanks for your feed back.

Like I said in my previous post, I will add into the next release a new ConvertBitonalToGrayScale() method which will fastly convert a 1bpp image to high quality grayscaled 8bpp image.

Regards,

Loïc

gcorgnet
Posts: 4
Joined: Thu Nov 29, 2007 9:59 pm

Thanks

Post by gcorgnet » Sun Dec 02, 2007 8:34 pm

I look forward to that ...

Guillaume


PS: Any reason why we can't save an image as an array while converting it to pdf (accepted values are only "bmp", "gif", "png", ...) ?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest