March 01, 2021, 10:37:29 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Color2Grayscale by Matt Merkulov [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Color2Grayscale by Matt Merkulov [ 1+ years ago ] (Read 460 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Color2Grayscale by Matt Merkulov [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:39 AM »
Title :
Color2Grayscale
Author :
Matt Merkulov
Posted :
1+ years ago
Description :
From <a href="
http://blitzetcetera.org/
" target="_blank">Blitz et cetera[/url] article
Image used:
Code :
Code: BlitzBasic
;Color2Grayscale by Matt Merkulov
Graphics
640
,
480
,
32
i=
LoadImage
(
"image1.jpg"
)
DrawBlock
i,
0
,
0
For
y =
0
To
479
For
x =
0
To
639
p =
ReadPixel
(
x, y
)
b = p
And
255
g =
(
p
Shr
8
)
And
255
r =
(
p
Shr
16
)
And
255
c = .3 * r + .59 * g + .11 * b
WritePixel
x, y, c + c
Shl
8
+ c
Shl
16
-
16777216
Next
Next
WaitKey
Comments :
none...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Color2Grayscale by Matt Merkulov [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal