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 geometric library. Show all posts
Showing posts with label geometric library. Show all posts

Saturday, June 29, 2013

An easy way to draw lighting bolts

Recently I was programming some stuff by using Maccala and some other P2P libraries. They are here to make Computer Graphics as easy as possible.

There was a moment when I needed to draw a vector lighting bolt symbol. What a boring task !!! It's harder than we imagine at a first sight. Twenty minutes after beginning this job, it was clear to me: I really wanted an easy way to make that kind of drawings we use to represent bolts.

I spent some time, but I created a method to generate any kind of lighting bolt. I made it so configurable as I could imagine, what turned the mission into something more complicated.

Maybe it doesn't look very interesting for you, but, from now on, I can save my fingers every time I need to render something like the drawings you see below. I prefer to work hard once, so I can be lazy many other times. :)



 Subscribe in a reader

Friday, June 21, 2013

More advanced arrow drawing styles and configuration

Since I released my vector based drawing library for the first time and started using it, there was many ways to draw arrows, because it already had very customizable methods to make it. You can even see a screenshot about it at the web page about Maccala's features.

Anyway, the library had some limitations, as for example: just straight arrows could be drawn and only using a chosen but fixed thickness for arrow body.

I have recently created more methods in my class responsible for drawing 2D vector based objects in a canvas, including methods to draw more configurable and generic arrows. Summing up the old and the new features, now arrow drawing tasks can take advantage of these main features:

- ability to draw straight or curved arrows;
- use of arbitrarily progressive arrow body thickness;
- use of highly configurable arrow head shape;
- ability to draw arrow head in both sides if desired;
- use of any RGB color;
- use of configurable high level anti-aliasing.

Below you see some examples of arrows created by using the new features I have developed.


 Subscribe in a reader

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

Tuesday, May 28, 2013

A new 3D rendering style for solid wire-frames

Now I'm improving one of my new 3D rendering engines by adding new features. It's one more set of improvements for my vector based drawing/rendering library named Maccala.

I'm doing all of this because I have great plans. In fact, I'm developing the functionalities I will need to create new graffiti text effects.

There is a new feature that is almost ready to use. I called it "clean solid wire-frame rendering". It helps to render 3D text that has just the essential lines in the thickness dimension.

It can seem to dummies it's just a trivial simplification, but it's not. It was very hard to develop because the shapes need to be drawn solid and opaque (it goes beyond the technique called "hidden lines removal"). My other solid wire-frame rendering algorithm already was very complicated and strongly based on heuristics. This "clean up" of edges invalidated most of tricks I have used before and needed a lot of other ones. It was almost a total redevelopment involving very hard work.

Below I show this new 3D rendering algorithm in practice. First you see a "normal" 3D wire-frame text and so a "cleaned" 3D wire-frames text created by using my new drawing style.


 Subscribe in a reader

Wednesday, July 13, 2011

Maccala improvement: Curves simplification again

The first implementation I did for curves optimization was good, but not good enough. In very extreme situations, the algorithm could fail, so the result of simplification was a curve with a different shape from its original form.

After some more hard work, I could finally develop an algorithm that I was not able to make fail, even when simplifying the more bizarre font faces I have ever found in my whole life.

Below I show some more tests made using even more weird and complex fonts than the ones tried before. It's never easy, but my vector drawing library is getting more and more powerful.





Subscribe in a reader

Saturday, June 25, 2011

Maccala improvement: Curves optimization

Picture to People Project has the best and biggest set of text effects around the Internet and much more will be released yet. It was possible just because our software haa a strong foundation: our low level libraries are powerful and are constantly upgraded.

These days I have been improving Maccala again. The vector based rendering engine is receiving an important optimization: an algorithm able to make curve simplification with almost zero quality lost. The main advantages this technique will bring are:

- reduced memory usage for curves/fonts representation;
- faster 2D curve drawing;
- faster set operations over polygons;
- faster 2D font rendering;
- faster 3D text rendering.

In fact, my biggest motivation to make this right now is to help to accelerate the realistic 3D text renderer I'm developing, but many vector based P2P tools will benefit from that.

Most time I use the font rendering engine to test this optimization. If the algorithm can simplify strange fonts with no visible quality loss, so I can suppose it's working correctly.

Since I'm very excited about this improvement, I show below some examples about what it can do and how it works. Each image shows the simplification of an "a" letter of a different font. At left, you can see the points representation and at right the generated drawing.

The tiny black dots are the points used to create the character; the black continuous curves regions usually are dozens or even hundreds of points very close to each other and they just happen in the non-simplified (top-left) chars. What is important here is: when a simplified "a" is drawn, it has the same looking than the non-simplified one, so the quality decreasing is negligible. The simplification has been made to be a nondestructive process.





Subscribe in a reader

Saturday, June 18, 2011

Maccala improvement: Adaptive Curves

Picture to People makes vector based drawing using Maccala API. It's very powerful and robust, so P2P has many tools that make/use 2D rendering.

Anyway, there was a small problem when drawing curves. They are more difficult to render when they have these two properties at the same time:
1) to have very strong or sharp curvatures;
2) to be too thick.

In this situation, some curves were not drawn smoothly as they should be. It's what I show you in the first image below. You see a curve skeleton and its version with a thickness of 150. Basically the thin curve shows how smooth it really is, but the thick one is not that smooth.

I improved Maccala and now it has adaptive curve drawing. In practice, it means Maccala can draw perfectly even very thick regions that are too curved. The second image shows the same curve as before, but perfectly drawn using my adaptive rendering algorithm.

Now Picture to People can draw super professional 2D vector curves even in the more unfavorable situations. It can help, for example, to draw in higher quality a thick outline of some very weird and complex True Type fonts.



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

Thursday, February 26, 2009

How related can be 2D and 3D libraries?

People have been asking me if I'm doing a completely new piece of software and new studies/researches for 3D tasks.

Well ... the answer is "yes and no". It sounds strange, but I will explain.

I'm really doing new libraries regarding source code. Despite in a Math sense a lot of 2D operations and transformations are just a special (simpler) case of 3D ones, the 2D implementation shouldn't pay the overhead of a 3D (more complex) one.

Anyway, after some more time, it will bring other good consequences. Usually, to be really flexible, 3D rendering software need a very modularized project, usually not needed in 2D rendering software. Being clearer: every software should have modularization and encapsulation (preferably in a object-oriented meaning), but it's a good idea take this to extreme in 3D projects. So, if you can, don't mix 2D and 3D libraries.

Just in a software sense, I'm creating new libraries. But, considering all of this in a Math sense, things are not so disjoint. If you understand and know how to implement math in 2D world, usually you are able to generalize it for 3 (or more) dimensions without study a lot.

Even separated in different source files or so, 2D and 3D libraries can be very related concerning analytic geometry and vector calculus.

Subscribe in a reader

Wednesday, July 16, 2008

Computer Graphics libraries

People have been asking me a lot about Computer Graphics researches and libraries.

Well, all I use is made by me. If I have just one or several libraries is a philosophical discussion for me. My software architecture lets me distribute only low level parts if I would like, but it doesn't matter. It's all part of the same project and goal: a professional software with absolutely no dependencies.

Despite this huge project has been made by just one person, there is another very big difference. Second what I know, I have the only, non commercial, made from scratch library big and strong enough to make all the hundreds of different low level tasks by itself and also the complex filters/effects constructed over.

The free CG software world is like this: usually you can see some few low level libraries for very specific tasks or offering only raw tools. When you find a software for more complex operations, it is always based on one or more lower level libraries. In other words: in fact a lot of thing is out of control.

I make everything at all. For now it can look irrelevant concerning the final result, but it isn't. Life cycle of open source libraries is very unpredictable. As the time goes, the total control I have over everything will make me more and more powerful to deliver new results.

Wednesday, November 7, 2007

The world is made of vectors



I'm still coding a library for vector manipulation.

I want to make only the seed and upgrade it step by step. Anyway, a good work needs planning and careful implementation of the basis functions and operations.

Some people like to say that vector problems can always be solved with a matrix operation. Of course it's not true and talking about vectors to solve pixels problems it's worse.

The picture shows some tests about the geometric library in development.

From now, the minimal coding needed will last a week or more.