Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to extractCMYKChannel with accompanying example and docs. #8

Merged
merged 1 commit into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ <h3>Riso.fill(value);</h3>
createCanvas(500, 500);
let blueChannel = new Riso("blue"); //create riso object, set to blue

blueChannel.fill(255); // completely opaque
blueChannel.fill(255); // completely opaque
blueChannel.ellipse(0, 0, 100, 100); //draw ellipse on blue layer

blueChannel.fill(50); // fairly transparent
Expand Down Expand Up @@ -324,7 +324,7 @@ <h3>Riso.cutout(p5.Graphic);</h3>
blue.ellipse(0, 0, 100, 100);
red.ellipse(0, 0, 150, 150);

//completely removes any intersection of red and blue
//completely removes any intersection of red and blue
//layers from the blue layer
blue.cutout(red);
drawRiso();
Expand Down Expand Up @@ -367,10 +367,10 @@ <h3>extractRGBChannel(img, channel);</h3>

<div class="description" id="channelCMYK">
<h3>extractCMYKChannel(img, channel);</h3>
<p>Extracts a cyan, magneta, yellow or black color channels from an image, and saves as a new image. Takes in two parameters:</p>
<p>Extracts the cyan, magneta, yellow and/or black color channels from an image, and saves as a new image. Takes in two parameters:</p>
<ul>
<li><b>img:</b> a p5 image object</li>
<li><b>channel:</b> the channel to extract. Can either be a channel name ("cyan", "magenta", "yellow", "black") or number (0, 1, 2, 3) </li>
<li><b>channel:</b> the channel(s) to extract. Can either be a channel name ("cyan", "magenta", "yellow", "black") or number (0, 1, 2, 3) or channel set string ("cy", "mk", "cyk")</li>
</ul>

<pre><code class="language-javascript">
Expand Down Expand Up @@ -399,7 +399,7 @@ <h3>extractCMYKChannel(img, channel);</h3>
</div>
<div class="description" id="dither">
<h3>ditherImage(img, type, threshold);</h3>
<p>Reduces an image to one color using patterns of dots to create greys.</p>
<p>Reduces an image to one color using patterns of dots to create greys.</p>
<p>Takes three parameters. The first is the image object. the second is the dither type (choose between atkinson, floydsteinberg, bayer or none). The third sets the threshold (it only applies to bayer and none). Dither type 'none' simply applies a threshold, turning pixels above and below the threshold clear and black.</p>

<pre><code class="language-javascript">
Expand Down Expand Up @@ -462,7 +462,7 @@ <h3>exportRiso();</h3>
<p>Use this function when you are ready to print. It exports all riso layers as individual png files, that can be printed in different ink colors. You should call this function in an event listener like mousePressed, or at the end of your setup function.</p>

<pre><code class="language-javascript">
let blue;
let blue;
let red;

function setup(){
Expand Down
15 changes: 15 additions & 0 deletions examples/CMYK-Compression/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>p5.riso channels example</title>

<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.js"></script>
<script src="../../lib/p5.riso.js"></script>
<script src="p5.dom.js"></script>

<script src="sketch.js"></script>
</head>
<body>
</body>
</html>
Loading