Page MenuHome

GPencil: Trace images using Potrace lib
Closed, ResolvedPublicTO DO

Authored By
Antonio Vazquez (antoniov)
Aug 18 2020, 12:28 PM
Tokens
"Love" token, awarded by illussimo."Love" token, awarded by Andrea_Monzini."Love" token, awarded by franMarz."Like" token, awarded by lightbwk."Love" token, awarded by amonpaike."Burninate" token, awarded by jorsh."Love" token, awarded by EAW."Like" token, awarded by AonoZan."Love" token, awarded by Kronk.

Description

Trace images and convert to grease pencil strokes.

For tracing, Potrace lib will be used (the same used in Inkscape).

Revisions and Commits

Event Timeline

Antonio Vazquez (antoniov) changed the task status from Needs Triage to Confirmed.Aug 18 2020, 12:28 PM
Antonio Vazquez (antoniov) created this task.

Rather than doing this from the image editor, this could convert an image empty to a grease pencil object. So you could drag and drop an image into the 3D viewport and then convert it.

The downside would be that it's not very discoverable, but doing it from the image editor isn't particularly discoverable either.

For a more discoverable version, there could be Add > Grease Pencil > From Image ..., which could open a file browser similar to Add > Volume > Import VDB... .

I like more the open image solution. Not sure if also keep the option in the image editor.

Anyway, I'm going to look how do the open file browser for an image.

I guess the downside of doing it immediately from the file browser is that you don't always get to see the image and tweaking the parameter is not so obvious without looking at the image?

Another way of doing it would be for the From Image ... operator to be a macro that first calls the operator to add an image object with the file browser (as already exists for Add > Image), and then in a second step calls an operator to convert the image to a grease pencil object.

Yes, the reason to do it in Image Editor was to see the image before. Actually, I call a python popup menu to define parameters and then call to the operator. I used the Bake operator as model to define the popup because the redo panel was not an option (the trace was done before tweak any value).

Usually, all trace tools display the image and then you press trace.

Actually I don't see problems in:

  1. Open image editor and load the image you want trace. You can look and maybe in the future apply any transformation (for example transform to BW)
  2. You select the trace option and define the parameters
  3. Press Trace button.

Opening directly from browser skip step 1) and this can be valid in some situations, but normally you want see what are you doing.

About macro, you mean create a "double" call like is done in duplication of objects, first call duplication and later call to transform... it could work, but really we save work to the user?

The point is not so much to save work, but to have a consistent workflow. Going into the image editor to create an object in the 3D viewport is inconsistent with other operators and tools we have. When you create something you do that in the editor where you can see and edit the thing that was created.

In Inkscape I think you also add a bitmap into your document and then convert it in place.

I have decided to use Empty images because it's the most intuitive way. Now, the option is not in the Image Editor.

I don't know if there is a way to calc automatically the scale, because don't know what scale is using internally Potrace.

EDIT: I think I have found a way to calc the correct scale.