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



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

Rank: Member

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

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?

Bobby Valentine
#2 Posted : Thursday, February 09, 2006 4:23:27 PM(UTC)

Rank: Advanced Member

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

Thanks: 2 times
Was thanked: 26 time(s) in 26 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
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.