Video recording underway. Press menu button or "v" to stop. The video will be saved to your downloads folder afterwards.
diff --git a/liquify.js b/liquify.js
index 1bdc27c..7f1ed3e 100644
--- a/liquify.js
+++ b/liquify.js
@@ -1,30 +1,24 @@
/*
To do list:
dynamic cursor size based on brush size
-Can the brush also mix in other colors? i.e., a default color bias
Add brush for restore, which draws the original picture on that spot
-Add brush for add color, which adds a blob of colour on that spot, which can then be smudged
For generative background:
-Better color choices -- based on HSL scale instead? Start with palette then allow random
Allow user to choose "null colour" which get dragged from outside the canvas edge. Right now it appears as transparent in the png
-Allow user to adjust exponentially power (hard square vs. smooth circle)
-Hide "Select Image" button in the GUI when ColorGrid is chosen
+Make the GUI dynamic (show/hide "Select Image" button in the GUI, etc.)
+Organize GUI into folders? (brush options, marker options, etc...)
On mobile, screen can become unscrollable (can't save or change options)
Test the lock canvas feature on mobile (can user scroll the page after?)
On mobile, screen touch position can become unsynced from the canvas
Allow color palettes for the Mondrian grid painting
Allow to set default angle of the perlin noise field (and direction of draw/increment)
-Experiment with different parameters on the flow field that might look better
Add toggle for generative movement option (random, flow field, circular swirls) -- allow the agent to choose randomly
Add website about section / link div
Mode where you can animate upon manual mouseclick (triggers animation draw with user input)
- For example, can make it look like a car tyre is spinning
-Animation speed toggle (make the x movement and orbit speed slower)
Radius should scale based on brush size
Try some videos played in reverse (reconstructing the original image)
-Gradient background flow field needs to be separated from marker flow field (higher resolution)
-Image input function is broken (need to check, originalimg not updating correctly?)
Mobile video export is broken
+Experiment with multiple marker agents at the same time (need to make each agent an object?)
*/
var image,
@@ -40,6 +34,7 @@ oldMouseY = 0;
var markerToggle = true;
var markerColor;
+
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d", {
willReadFrequently: true,
@@ -50,6 +45,7 @@ var canvasHeight;
var maxCanvasWidth = 2000;
var maxCanvasHeight = 2000;
+var animationSpeed;
var animationRequest;
var playAnimationToggle = false;
@@ -57,8 +53,7 @@ var playAnimationToggle = false;
var imageInput = document.getElementById('imageInput');
imageInput.addEventListener('change', readSourceImage);
var isImageLoaded = false;
-var userImage;
-var originalImg = document.getElementById('originalImg');
+var userImage = document.getElementById('userImg');
var actualWidth = 600; //size of default image
var actualHeight = 1000;
@@ -66,86 +61,7 @@ var scaledWidth = actualWidth;
var scaledHeight = actualHeight;
var widthScalingRatio = 1;
var maxImageWidth = 1080; //can be tweaked
-
-function getUserInputs(){
- BRUSH_SIZE = obj.brushSize;
- SMUDGE_SIZE = obj.brushDensity/100 * BRUSH_SIZE;
- LIQUIFY_CONTRAST = obj.opacity/100;
- markerColor = obj.markerColor;
- console.log("Brush size: "+BRUSH_SIZE);
- console.log("Smudge size: "+SMUDGE_SIZE);
- console.log("Opacity: "+LIQUIFY_CONTRAST);
-}
-
-function chooseBackground(){
-
- if(playAnimationToggle==true){
- playAnimationToggle = false;
- cancelAnimationFrame(animationRequest);
- console.log("cancel animation");
- }//cancel any existing animation loops
-
- backgroundType = obj.startingCanvas;
- console.log("background type: "+backgroundType);
-
- canvasWidth = obj.canvasWidth;
- canvasHeight = obj.canvasHeight;
- canvas.width = canvasWidth;
- canvas.height = canvasHeight;
-
- generatePerlinData();
-
- if(backgroundType == "ColorGrid"){
-
- var rows = 8;
- var cols = 8;
- var cellHeight = Math.ceil(canvasHeight / rows);
- var cellWidth = Math.ceil(canvasWidth / cols);
- var baseColor = rgbToHex(Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255));
- var backgroundColorRange = 150;
-
- //draw grid of colors
- for(var i=0; i