What is Picture to People ?

"Picture to People" (P2P) is a huge Computer Graphics project. It was started to create new softwares able to make 2D drawing, 3D rendering, vexel drawing, text effects, photo effects, image filtering and other complex Computer Graphics operations. It has been made from scratch, including its low level Computer Graphics libraries like Maccala. Nowadays, most final features produced for this project are released as free online tools available from its official website. This blog talks about Computer Graphics, mainly concerning Picture to People development.

"Only who makes has true knowledge. Knowledge is control. True power depends on total control. Only who makes from scratch has the real power."

Showing posts with label filling operations. Show all posts
Showing posts with label filling operations. Show all posts

Wednesday, June 19, 2013

Drawing curves with progressive thickness

Here I show you one more recent improvement for my vector based rendering library called Maccala.

Now it's possible to create any kind of curve with an arbitrary progressive thickness. I guess it's kind of strange I have never developed this before, but I have never needed something like this until now.

Surprisingly, it was harder to develop than I imagined initially. It was needed to redevelop my algorithm responsible for creating a thick shape based on a Math curve (conceptually a curve has no thickness at all).

In fact, in a generic algorithm, even drawing operations (in this context, "draw" means "render the contours") are tackled as filling jobs. First an assembling algorithm constructs a shape with an arbitrary thickness, so a filling algorithm can render it.

Below you can see a curve drawn with variable thickness. Now it's possible to make something like this so easily as calling a method. Unnecessary to say, the professional anti-aliased rendering is still there.
 Subscribe in a reader

Saturday, June 15, 2013

Sub-pixel precision drawing for vector based render engines

I'm really impressed with the fine quality increase I got by improving the sub-pixel precision of my 2D render engine, which I use in Maccala library. I don't need to make any more some post-processing operations when rendering some complex text effects.

I have received some emails from colleagues asking about this change after I talked about this improvement here. They are CG developers too and were kind of confused about what I meant in my previous post about this subject called "Subpixel vector drawing with professional antialiasing".

First of all, don't be confused between "sub-pixel positioning" and "sub-pixel precision". In the first one, we know how to properly draw the bodies despite they can be in fractionary positions, but it doesn't mean we can draw bodies smaller in size than one pixel.

As an example, I borrowed an image from the webpage about Maccala's features. You can see many line segments with a progressive thickness. All of them are positioned in sub-pixels positions, but just the first one is thinner than one pixel (its thickness is 0.5).
In fact, the real elegance of my algorithm is that it had always been ready to draw shapes and curves with any precision. To make it really work for unbelievably tiny precision limits, I just needed to improve the Math about some boundary conditions.

Of course, nothing comes really for free. To keep the professional anti-aliased results when using "microscopic" measures, the algorithm must be used with extreme parameters, decreasing its big rendering speed.

 Subscribe in a reader

Tuesday, October 30, 2012

Rendering engine with professional anti-aliasing

Picture to People already had one of the most professional 2D vector based rendering engines in the market. This engine is part of my Maccala library and it has proved to be very fast, precise and reliable these last years, because it was successfully used to create most text and photo effects P2P already offers.

Anyway, recently I have discovered a small bug that only happened in very special conditions related to clipping operations. By the way, it's worthy to know that all vector based drawing operations are "clipping aware" or, in other words, shapes are drawn naturally clipped.

This problem was very subtle and affected just the bound pixels close to the clipping frame. In specific conditions, the ingenious (integer based) calculations of the renderer could need to deal with unexpected negative values, generating wrong results.

Below you can see a wrong rendering (left side) and a correct one (right side). The blue squares represent the clipping windows and the small red squares highlighted the region that failed in the left drawing.


Here I show the small regions increased 10 times in size, so you can see clearly the wrong pixels and how they were fixed in right side image.



Now my 2D anti-aliased drawing algorithm is even more precise, and it's not all. Seizing the opportunity and the knowledge I acquired these last years, I have improved the algorithm speed even more. After these recent optimizations, the drawing operations are kind of 17% faster for most cases.

P2P keeps its commitment to offer the most professional softwares, so you can generate more and more outstanding results.

 Subscribe in a reader

Sunday, November 13, 2011

Cartoonize your photos

It was never so easy to transform your photos in beautiful detailed cartoon style drawings. I took some months studying and researching to develop the Photo Cartoon software, but the results are really worthy.

I would like to show you another example about what can be made using it. You can generate smart smooth regions controlling the gradient options and detailed strokes lines by setting the contour interface items (the contour lines can be softer if you desire).

Below you see a very detailed photo used as input and two cartoon images created using my renderer. The first one has more well defined filling regions and very delicate contours. The second example has very large smoothed regions and smartly selected contours lines. Both of them preserve the original details very well.




Subscribe in a reader

Friday, May 6, 2011

Maccala improvement: Polygon filling modes

During these last years, this blog showed the development of my 2D drawing library called Maccala. I really passed through many problems and challenges since I started it more than four years ago.

Nowadays I have a very comprehensive, professional, powerful and robust library for 2D drawing, font rendering and vector based effects, but I knew it had a point to be solved: the polygon filling modes. Since its first days, the library had only the alternative filling mode. I always knew about this weakness, but I have let it behind, since its only mode always was enough to my needs until now.

Currently I'm developing a new sub-library especially to make typography effects. At this point, the lack of another filling mode became a barrier to creation of my new effects.

I'm (finally) implementing the winding filling mode in Maccala. Since it's more complex by nature, I'm taking a big care about performance, so I can draw using any filling mode with no (or very few) performance penalty.

If you don't know what I'm talking about, let's put it simple: the winding mode can be imperative when filling some kinds of polygons that have self-intersection. This kind of polygon is very common, mainly when you make some operations like polyline thickness widening.

Below there is a simple example. First I show a self-intersected polygon. Second I show the same polygon filled using the alternative mode. As you can see, a colateral effect of this technique is that, in this case, the polygon is not completely filled. Finally I show the winding mode applied to our polygon. It has the behavior we usually want in this situation: the polygon is totally filled.



Subscribe in a reader

Friday, March 13, 2009

More power to Picture to People libraries

Despite hundreds of effects I already could code in Picture to People site with the libraries I have, I'm not satisfied.

I want more. I would like to have the more powerful (non-commercial) Computer Graphics libraries ever. I think the most powerful CG libraries should offer advanced vector based operations over arbitrary sets of pixels.

With some hard effort, I could find a professional anti-aliasing level making complex operations over bitmaped images. Now it has been a big challenge to take my vector libraries to the next level: be able to make all this operations with an arbitrary alpha channel by input pixel. Beside this, each drawing object can have self-overlapping.

This new kind of operation turns useless a lot of common algorithms for anti-aliased filling and drawing. The reason is simple: when you have to deal with so complicated alpha requirements, the anti-aliasing techniques can not generate any over-painting. If so, your alpha calculations will get wrong, compromising the final drawing.

I'm very busy with this complex low level problem, so I'm not having time to post.

Subscribe in a reader

Monday, November 12, 2007

Just filling ...



Now I'm expanding the limits of my vector based library. I'm trying to "stress" it and construct new operations based on it.

I'm coding "filling" functionalities using vector operations. My vector based algorithm can fill 99% of the pixels for degenerated curves like that showed in the picture. Probably I could achieve 100% for any curve using antialiasing operations. However, filling is already a very expensive operation. I don't think antialias overhead is worthy in this case.

Filling algorithms are a very interesting subject in CG by itself. This problem can have many derivations depending on if you are rendering, drawing, making masks, etc.

A good software must have a rastering based filling too. It doesn't matter how powerful or hardware enforced your vector based library is, sometimes you just don't have a vector based representation of what you want to fill.

Since filling is my subject for now, I'm thinking about to code a raster filling now (putting the vectors aside for a while). People with some experience in CG can think: "Very easy, huh? You just need to have a recursive function like [SetPixel]. The implementation of that has inside 8 new calls of [SetPixel] for the pixel neighbourhood."

Do you really think it's a good choice? I will give my opinion about that in next post.