README.md - webgbcam - [fork] gameboy webcam
HTML git clone git://src.adamsgaard.dk/webgbcam
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
README.md (5958B)
---
1 # webgbcam
2
3 A simple Game Boy Camera-style filter made in HTML5 and JavaScript
4
5 [Play with it here!](https://maple.pet/webgbcam/)
6
7 ## Disclaimer
8
9 As of this commit, this is simply a direct copy of the files currently in my webserver.
10 Eventually, I will clean things up and make improvements to the code, but since there
11 has been interest in looking at the code, I'm mirroring the files here.
12
13 ## A quick explanation of how it all works
14
15 The concept of [Bayer dithering](https://en.wikipedia.org/wiki/Ordered_dithering) was
16 hard for me to grasp at first, but after a [few different projects](https://github.com/Lana-chan/maples-retro-extravaganza)
17 getting acquainted with it, I've found an easy way to apply it, which can be used in
18 a procedural setting like JS Canvas filters, or shaders.
19
20 Basically, you start with an array of pixels, then grayscale them and optionally apply
21 simple arithmetics to apply gamma and contrast adjustments. Then, you offset those by
22 the value in the Bayer matrix corresponding to that pixel, giving it a patterned look.
23 Finally, you divide and quantize the values until all pixels each have only one of four
24 possible values. This will give you a dithered pixel art look. After this, my code applies
25 a palette swap for those 4 values back to RGB space.
26
27 ## Acknowledgements
28
29 Thanks to [Christine Love](https://twitter.com/christinelove) for making the Interstellar
30 Selfie Station back in 2014. It helped me a lot with my dysphoria and was the inspiration
31 to learning how Bayer dithering works in order to remake her camera app once it was no
32 longer available in app stores.
33
34 Thanks to [Joel Yliluoma's arbitrary-palette positional dithering algorithm](https://bisqwit.iki.fi/story/howto/dither/jy/)
35 page, which was the first analysis of ordered dithering that I found comprehensible and
36 used to implement the filter in different applications.
37
38 Thanks to [lospec.com](https://lospec.com/palette-list) for making a list of palettes available,
39 many of which were used in this project.
40
41 Thanks to [gbdev.io](https://gbdev.io/pandocs/Gameboy_Camera.html) for information on
42 the Game Boy Camera hardware, used for accurate filtering.
43
44 ## License
45
46 ```
47 Copyright (c) 2021 maple@maple.pet
48
49 The following license is modified from the Anti-Fascist MIT License and the
50 Anti-Capitalist Software License.
51
52 ANTI-FASCIST LICENSE:
53
54 The following conditions must be met by any person obtaining a copy of this
55 software:
56
57 - You MAY NOT be a fascist.
58 - You MUST not financially support fascists.
59 - You MUST not publicly voice support for fascists.
60
61 "Fascist" can be understood as any entity which supports radical authoritarian
62 nationalism. For example: Donald Trump is a fascist; if you donated to his
63 campaign then all rights provided by this license are not granted to you.
64
65 ANTI-CAPITALIST SOFTWARE LICENSE (v 1.4):
66
67 This is anti-capitalist software, released for free use by individuals and
68 organizations that do not operate by capitalist principles.
69
70 Permission is hereby granted, free of charge, to any person or organization
71 (the "User") obtaining a copy of this software and associated documentation
72 files (the "Software"), to use, copy, modify, merge, distribute, and/or sell
73 copies of the Software, subject to the following conditions:
74
75 1. The above copyright notice and this permission notice shall be included
76 in all copies or modified versions of the Software.
77
78 2. The User is one of the following:
79 a. An individual person, laboring for themselves
80 b. A non-profit organization
81 c. An educational institution
82 d. An organization that seeks shared profit for all of its members, and
83 allows non-members to set the cost of their labor
84
85 3. If the User is an organization with owners, then all owners are workers
86 and all workers are owners with equal equity and/or equal vote.
87
88 4. If the User is an organization, then the User is not law enforcement or
89 military, or working for or under either.
90
91 5. The User must not be involved in Non-Fungible Tokens or any other form of
92 cryptocurrency minting or exchange.
93
94 The above copyright notice and this permission notice shall be included in all
95 copies or substantial portions of the Software.
96
97 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY
98 KIND, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
99 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
100 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
101 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
102 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
103 ```
104
105 The license does not obligate you do so, but if you build something upon the code in this repository, I'd love to hear about it and I ask that you credit me in it.
106
107 [gif.js](https://github.com/jnordberg/gif.js) by Johan Nordberg:
108
109 ```
110 The MIT License (MIT)
111
112 Copyright (c) 2013-2018 Johan Nordberg
113
114 Permission is hereby granted, free of charge, to any person obtaining a copy
115 of this software and associated documentation files (the "Software"), to deal
116 in the Software without restriction, including without limitation the rights
117 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118 copies of the Software, and to permit persons to whom the Software is
119 furnished to do so, subject to the following conditions:
120
121 The above copyright notice and this permission notice shall be included in
122 all copies or substantial portions of the Software.
123
124 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
125 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
126 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
127 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
128 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
129 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
130 THE SOFTWARE.
131 ```