I've been looking around and I've found some libraries for encoding video within a running Processing app, but I'm pretty confused about what's available and what's out of date. I've found GSVideo, the Video library, and other libraries. What I need is a library that can encode video from an ArrayList of PGraphics and a sound file. Is there a good solution for this available? I am not interested in realtime capture. I know there are applications outside of Processing that can do this, but I'm hoping to find something that I can use within Processing. Any input?
Anyone have any info or know of any libraries that deal with animated PNGs? I'm currently working with GIFs and the gifAnimation library to import animated gifs and put the frames in a PImage array. I'd like to do the same with APNGs. Anyone?
I've been playing around with creating a drawing/painting program. So far I've received a lot of good help and have had some luck. I've run into one problem that has me stumped. It might be a limitation of PGraphics or Blend, a bug, or I'm just doing it wrong.
Basically, I am drawing onto a PGraphics (tempCanvas), and based on the value of a boolean (the "B" key) the tempCanvas will copy itself in front of the main PGraphics (canvas) or behind it. This is done when the mouse key is released. This, in effect, allows you to paint on top of the canvas or from behind. All of this works as intended, except when painting "behind", each time the mouse is released all of the color values in the PGraphics get one increment darker. If you click 20 or 30 times you can really start to see the effect on white.
The right mouse button paints black (almost black) and the left mouse button paints white. "B" or "b" toggles the paintBehind boolean. I am seeing the problem in line 87 below. This code is part of a larger program I've been working on and I threw this together to illustrate it. I saw in the refernce material that maybe blendMode() is preferable to blend, but I'm unsure if that is the case here. I'm also wondering if P2D would be better, but I am unhappy with the appearance of that renderer for what I'm doing.
I'm hoping for a little direction on something. In a sketch I create an ArrayList of PGraphics, starting with just one image. The image can be drawn on with the mouse. Using the right arrow key you can create a new PGraphics and draw on that as well. The right and left keys serve to flip between the PGraphics. I would like to create a function to save all of the PGraphics to a file and another function to load them again.
I've been looking around for info on this and have some ideas, but nothing has been obvious enough for me to understand. Any help would be appreciated. Here is the simplified code of what I am working on:
int currentPage = 1;
ArrayList<PGraphics> pageCollection = new ArrayList<PGraphics>();
void setup(){
size(400,400);
background(255);
pageCollection.add(createGraphics(300,300));
pageCollection.get(0).beginDraw();
pageCollection.get(0).background(200);
pageCollection.get(0).endDraw();
}
void draw(){
frame.setTitle("Page " + currentPage + " of " + pageCollection.size());
Just wondering if it is possible to make a rectangular portion of a sketch background transparent in order to see the desktop? Can that be done dynamically?
I'm working on a sketch that traces a PImage using the diewald_CV_kit library and blob detection. So far I have it tracing my image just fine,even with nested multiple contours. I am running into a problem with the fill() function. The outer trace fills, but any inner contours are covered by the fill. The inner contours should become a window of transparency on the fill of the outer contour. Something like the breakShape() function provides, but it appears unavailable in 2.0. I am using code from the extract_letters in the diewald_CV_kit library. It does recognize outer and inner contours and colors them accordingly, so I'm hoping this won't be too difficult.
I really don't care about seeing the traces in the sketch. The PImages in the sketch will be a posterized grayscale images with 6 levels from black to white. A separate blob detector will be had for each color ( 4 grays, 1 black, and 1 white).
I will eventually work on exporting the traces as SVGs, so maybe there might be some functionality for that in the SVG library, I'm not sure. I really only care about the SVGs being output correctly.
I was wondering if anyone might be able to help me out with a snippet of code? I'm looking to generate a checkerboard pattern in a PGraphics image. The pattern you see in imaging programs to depict an area with full transparency, i.e.- a fine checkerboard of light and dark gray squares. The image size I'm working with is 640*360. Thank you.
I am new to Processing, but have programmed in VB, some WPF, and LabView.
I am interested in starting on a flip-book animation program, in which you draw sequential images and can play it back as an animation. It would be nice to save it as a single file for loading, but saving it as a sequence of images (png with alpha) would be just fine. I would want to do that anyway for rendering a video file in post processing. I don't care about layers (yet) or sound. Being able to see a ghost of the previously drawn image would be good (onion skin).
Anyway, I'm looking to program something like this and then add features as it goes. Anyone ever worked on anything like this, seen examples or tutorials, or know a bit of code to get me started? Not looking for the solution, just a bump in the right direction as far as Processing code. I'm looking for a simple base to start with. I've found examples of drawing with a mouse and I will probably start there. I looked through the forums and didn't see anything along this line.
I'm also looking to integrate my Wacom tablet, but that's a side point.