Convert color image to 24-bit or 8-bit grayscale

Share your advanced PureBasic knowledge/code with the community.
bytecave
User
User
Posts: 40
Joined: Mon Aug 13, 2012 7:26 am

Re: Convert color image to 24-bit or 8-bit grayscale

Post by bytecave »

Hi Wilbert,

Not sure you're if you're still active here on the forums. I'd like to use your Grayscale routine in an open source game. What's the best way to attribute it to you? Thanks! --Rich
wilbert wrote:Here's my asm version module also if you want to compare the speed of that as well.
This time no SSE :shock: It will run on even the oldest hardware, is cross platform and supports both 24 and 32 bit images.
Grayscale::Grayscale(MyImage)

Quality optimized version

Code: Select all

DeclareModule Grayscale
  Declare Grayscale(Image)
EndDeclareModule
<...snip...>
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Convert color image to 24-bit or 8-bit grayscale

Post by wilbert »

bytecave wrote:I'd like to use your Grayscale routine in an open source game. What's the best way to attribute it to you?
You can add a comment to the module code itself like Grayscale Module by Wilbert.
You don't have to mention my name in the compiled version of your game. :)
Windows (x64)
Raspberry Pi OS (Arm64)
bytecave
User
User
Posts: 40
Joined: Mon Aug 13, 2012 7:26 am

Re: Convert color image to 24-bit or 8-bit grayscale

Post by bytecave »

wilbert wrote:You can add a comment to the module code itself like Grayscale Module by Wilbert.
You don't have to mention my name in the compiled version of your game. :)
That is great, thanks Wilbert. Really great code! --Rich

;
;Grayscale Module by Wilbert
;http://www.purebasic.fr/english/viewtopic.php?p=482418
;
Post Reply