Re: [Mypaint-discuss] Vector Data and GSoC
On 4 March 2013 23:41, Kolja Lubitz pinguin...@gmail.com wrote: Hi Hi Kolja, I'm thinking for a while about adding some kind of vector support to MaPaint. The main idea is a Paint program in which you don't have to care about pixel. The main workflow should be open the program and you start with a white surface and then you can start painting and only in the end if you press save you decide in witch resolution you like to have your pic. On the technical side it is very simple. While painting we need to store all input data and scale and brush. And on save the brushes will be rendering to a png or so. I agree with your vision, users should not have to care about pixels most of the time. MyPaint already stores most of the input data. Check out the classes with names like Stroke in lib/stroke.py etc. At the moment it is used for the change last stroke feature that one can toggle on/off in the brush settings editor, and probably for the bezier curve lines. Previously it was used for undo/redo as well, but that was found to be too slow. That is probably going to be the main challenge: performance. In the traditional raster model, where one destructively update a set of tiled mipmapped raster surfaces as changes are made, rendering the document to screen or to a bitmap export is very fast as it only requires compositing the layers together (at the appropriate mipmap level) and blitting it to the screen/bitmap. I am not sure how to efficiently represent a document of MyPaint brush strokes as vector data that can be rendered as fast. To try out the idea, and as a first useful step, you could try to implement a lossless resize document feature? Use the existing stroke infrastructure to store all input information (probably needs some additions as well), and when invoking this function the user can choose to make the document say 2x bigger or smaller. MyPaint should then replay all the strokes onto different size surfaces, and the result should be as if one had been painting at that resolution all the time. That should give you a feeling for how feasible it would be performance wise, and let you understand how such things can be done inside the MyPaint code. -- Jon Nordby - www.jonnor.com ___ Mypaint-discuss mailing list Mypaint-discuss@gna.org https://mail.gna.org/listinfo/mypaint-discuss
Re: [Mypaint-discuss] Vector Data and GSoC
This is interesting. Last time I checked the .ora file (it's just a zip file, so you can see it yourself), I seem to remember seeing the stroke info saved to file. If true, this means that vectorized data is already saved. I also believe the main problem would be performance, but only when changing zoom levels or panning, since this would be what triggers a Render Tile operation. Cache techniques could be used. With some work, it could be possible to enable painting while still rendering tiles on low priority threads to avoid stuttering while painting. I'm not sure this would be simple at all, even though it may seem like it at first sight... - You'll have to somehow get a list of only the interesting strokes for the current canvas view, otherwise each time you zoom in / pan, it will be VERY slow on complex paintings - You'll also have to deal with bitmaps for .ora files that don't have mypaint-specific vector info - If the brush behaviour changes in mypaint, an ORA file will look different when re-rendering - You'll have to make sure the brushlib behaviour is deterministic -- Micael Dias ___ Mypaint-discuss mailing list Mypaint-discuss@gna.org https://mail.gna.org/listinfo/mypaint-discuss
Re: [Mypaint-discuss] Vector Data and GSoC
I seem to remember seeing the stroke info saved to file. It saves the strokemap only -- that is, each brush used paired with a 1bit bitmap indicating coverage. This is enough to enable brush picking, but includes no direct stroke info. On Thu, Mar 7, 2013 at 12:28 PM, Micael kam1k...@gmail.com wrote: This is interesting. Last time I checked the .ora file (it's just a zip file, so you can see it yourself), I seem to remember seeing the stroke info saved to file. If true, this means that vectorized data is already saved. I also believe the main problem would be performance, but only when changing zoom levels or panning, since this would be what triggers a Render Tile operation. Cache techniques could be used. With some work, it could be possible to enable painting while still rendering tiles on low priority threads to avoid stuttering while painting. I'm not sure this would be simple at all, even though it may seem like it at first sight... - You'll have to somehow get a list of only the interesting strokes for the current canvas view, otherwise each time you zoom in / pan, it will be VERY slow on complex paintings - You'll also have to deal with bitmaps for .ora files that don't have mypaint-specific vector info - If the brush behaviour changes in mypaint, an ORA file will look different when re-rendering - You'll have to make sure the brushlib behaviour is deterministic -- Micael Dias ___ Mypaint-discuss mailing list Mypaint-discuss@gna.org https://mail.gna.org/listinfo/mypaint-discuss ___ Mypaint-discuss mailing list Mypaint-discuss@gna.org https://mail.gna.org/listinfo/mypaint-discuss