June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/*REXX program converts a RGB (red─green─blue) image to a grayscale image. */
|
||||
/*REXX program converts a RGB (red─green─blue) image into a grayscale/greyscale image. */
|
||||
blue= '00 00 ff'x /*define the blue color (hexadecimal).*/
|
||||
@.= blue /*set the entire image to blue color.*/
|
||||
width= 60 /* width of the image (in pixels). */
|
||||
|
|
@ -9,7 +9,8 @@ height= 100 /*height " " " "
|
|||
r= left(@.col.row, 1) ; r=c2d(r) /*extract the component red & convert.*/
|
||||
g=substr(@.col.row, 2, 1) ; g=c2d(g) /* " " " green " " */
|
||||
b= right(@.col.row, 1) ; b=c2d(b) /* " " " blue " " */
|
||||
@.col.row=d2c((.2126*r+.7152*g +.0722*b)%1) /*convert RGB number ───► grayscale. */
|
||||
end /*row*/ /* [↑] D2C convert decimal ───> char*/
|
||||
_= d2c( (.2126*r + .7152*g + .0722*b) % 1) /*convert RGB number ───► grayscale. */
|
||||
@.col.row=copies(_, 3) /*redefine old RGB ───► grayscale. */
|
||||
end /*row*/ /* [↑] D2C convert decimal ───► char*/
|
||||
end /*col*/ /* [↑] x%1 is the same as TRUNC(x) */
|
||||
/*stick a fork in it, we're all done. */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
blue= "00 00 ff"x /*define the blue color (hexadecimal).*/
|
||||
blue= '00 00 ff'x /*define the blue color (hexadecimal).*/
|
||||
blue= '00 00 FF'x /*define the blue color (hexadecimal).*/
|
||||
blue= '0000ff'x /*define the blue color (hexadecimal).*/
|
||||
|
||||
blue= '00000000 00000000 11111111'b /*define the blue color (binary). */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue