Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
valbros  
#1 Posted : Thursday, February 9, 2006 12:06:48 AM(UTC)
valbros

Rank: Member

Groups: Member
Joined: 11/11/2005(UTC)
Posts: 9

Hello,

I want to do a hue & saturation adjustment on a selective color on the server side. Files are 24 bit color, and about 600px x 600px. I've tested stepping through the Pixels(i, j) one by one and it is slow.

Q: Can I use the CopyMemory function you suggest on the server side through ASP using JScript or VBScript?

If not, any way to speed up the process on the server side using ASP?

Regards,

Bobby Valentine

Andrew  
#2 Posted : Thursday, February 9, 2006 4:23:27 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Hello Bobby,

I afraid there is no way to import WinAPI functions in VBScript/JScript.

I can see two ways to avoid using Pixels property.

  1. Wrap the necessary functionality in ActiveX control which you can write on VB6 or any other language. This approach used in the code sample which demonstrates how to handle Progress event in ASP.

  2. Get rid of per-pixel processing at all. If I understand you need to apply HSL processing only on a part of image. You can do it without per-pixel processing, if you manage to build a mask.

In last case the algorithm would be looking like this:

  1. Get a mask (grayscale bitmap of the same size where black means transparent area, white - opaque one). For example, in your case you can use Transparentize method, extract alpha channel, and invert it.

  2. Create a copy of the bitmap apply HSL transform on it.

  3. Replace the alpha channel of modified bitmap by the mask.

  4. Blend this bitmap with the original one.

As a result you will get modified color in the areas which correspond to white areas of mask (marked by Transparentize), and original color for black areas.

Hope this makes sense. Please feel free to post a message if something is unclear.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.