digital literacy for everyone



pstr.fgp




# < figplus code >
# comments | built-in functions | user functions | figplus extras | inline python



# 2019 mn
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

proginf = "posterise 0.1, mar 2019 mn"
filepath = "demo.png"

imgsize codimgsize filepath

width codget imgsize "w"
height codget imgsize "h"
now winsize width height

pic imgset 0 0 filepath
now display

cx2 width minus 1
cy2 height minus 1

for cx 0 cx2 1
for cy 0 cy2 1

now codrgbget cx cy
r codget now "r" divby 64 int times 64
g codget now "g" divby 64 int times 64
b codget now "b" divby 64 int times 64

now rgbset 15 r g b
now pset cx cy 15

next
now display sleep .005
next

now display lineinput




fig main page: https://freesoftwareresistance.neocities.org/fig/index.html

home: https://freesoftwareresistance.neocities.org