利用者:BeBraw/ImageEditorPlan

提供: wiki
移動先: 案内検索

In this page you can see my analysis of the current image editor. After the analysis you can see how it could be improved. Note that I am concentrating mainly on image editor, not on UV side of it.

Analysis of the Image Editor

Current Image Editor has some really basic tools that can be used to paint textures/sketch/touch up images to some extent. Compositing node system can be used to do some trickier tasks. Image editor contains currently draw, soften, smear and clone tools. All of these are dependant on brush settings. Also eyedropper can be found on right mouse button. Eyedropper can be used to change current color easily.

Brushes

It is possible to define custom brushes in the current system. Brush contains following properties: color, opacity, size, falloff, spacing, blend mode, wrap and airbrush. Furthermore it is possible to assign a texture to a brush. Note that the brushes are shared between image editor and texture paint mode. This is not true for other places, such as sculpt mode, weight paint or texture paint mode, in which brushes are used.

Undo System

Current undo system of the image editor is limited to one undo. It basically stores a copy of old image (one undo step) and then uses it in case the user invokes undo.

Node System Integration

Image Editor has been integrated to the compositing node system loosely. It can be used to preview nodes (Viewer node, render result) and sequences (http://www.blender.org/development/release-logs/blender-243/imaging/).

User Interface

Currently user interface of image paint is limited to one panel. It contains all tools, except eyedropper which is bound to right mouse button. Canvas can be zoomed and translated freely by using Blender's standard middle mouse button, mouse scroll based controls.

Improvement Suggestions

In this part I will take a look at some improvements that can be made to make the image editor more powerful.

Undo System

In this part I present three possible solutions that can be used to enhance current undo system.

Raw Force Solution

Raw force based solution would be like the current one except that it would store defined amount of steps in memory by using a suitable data structure such as a linked list. Obvious handicap of this would be nasty memory usage as each undo step would allocate chunks that are size of the original image. They could be probably compressed or cached on disk to compensate this issue.

This system would offer more undo steps compared to current system but at cost of memory usage.

Raw Force with Bounding Boxes

Linkedlistwbounds.png

This solution is based on previous but tries to manage with less memory used. When the user draws, the drawn path is stored to memory. By using this information combined to brush size (need to store this during drawing too in case it can be variable (pressure based)) a bounding box containing changes made to the image can be determined. Image within this bounding box and its coordinates can be stored to an undo step just like in previous solution. This should result in reduced memory usage.

Tile Based Undo System

In this solution image is split to tiles (split image on both x and y directions). These tiles are stored as undo based on user action. Tiles on which the user drew for instance are stored. This system is used painting programs such as the GIMP or Adobe Photoshop.

Store Actions

This solution takes the storing concept of bounding box one even further. In this solution an undo step contains an action. In case the user draws, whole drawing process is stored (again, remember pressure sensitivity). Process contains information such as time offset based on start, cursor location on canvas and brush used.

Undoing an action like this is not as easy as in previous methods. In this method an anti-action has to be performed. Anti-action is an action that reverts the situation back to normal by using the original action in inverse manner. For this each blending mode needs an inverse one defined.

This method of undo can be found in a program called openCanvas (http://www.portalgraphics.net/en/). I am sure there are others using this method as well.

The biggest advantage of this method is that it allows the user to playback the undo.

For this undo system to truly work, the drawing methods have to return accurate results every time. This means there is no tolerance for errors in painting (undoing just doesn't work if it is not done exactly right).

Note that undo step of action based system could be implemented by using tile based system. This would give benefits of both systems at the cost of some extra memory usage.

Layer System

Nodelayer.png
The system could look like this. Note that the image is currently missing blending mode option.


Current image editor has no layer system at all. However the compositing node system can be used to fake it. This is what I use as a basis for my proposal.

Basically a layer is something that contains an image and a blending mode. We have both these in Blender as nodes. Then why not to combine them into one node containing both (see image X). These nodes could then be linked to build a layer setup. This system would work as a separate node tree. This way nodes related especially image manipulation tasks could be put there and those not needed there could be removed from that part.

User Interface

This sort of layer system probably needs some sort of user interface within image editor itself. It would be good to be able to change active layer and to add/delete layers "on fly".

Brush System

Blending Modes

Blending mode menu is getting a bit crowded. A couple of spaces (------) in it and perhaps GIMP like organization of it might help.

Brush Attributes

It would be possible to enhance current brush system by decoupling certain attributes of the current system and by adding a couple of new ones. These brush attributes could be split into two groups: basic settings and advanced settings. Advanced settings would be such settings that are seldom needed. They mainly define a brush.

Basic brush settings are blending mode, opacity, falloff and size. I consider these the most important ones. Of course more settings could be exposed on basic mode should there be room in the user interface. Basic brush settings don't have to be exposed in the user interface by only using sliders. There could be an image of the brush containing handles that can be used to tweak it.

Advanced brush settings define the structure of brush. These settings can be such as spacing, fade out (distance based on which brush is faded out like in GIMP), angle, jitter (randomization) options for attributes such as rotation, roundness and like: spikes, shape, hardness and aspect ratio. Of course there can be more of these settings.

These aforementioned brush settings could be shown in the user interface in two separate panels. Another one could be general Tool panel that would contain all available tools and their settings. A button to summon "advanced" settings panel could be found in that panel. Or it could extend the current panel temporarily. (add images here!)

Other Brush Related Ideas

  • possibility to use GIMP brushes? http://cinepaint.org/docs/gbr.html
  • there should be proper preview for brushes (see what you get)
  • possibility to use numbers to set opacity fast (examples: hit 5 to set opacity to 50 %. Hit 46 to set opacity to 46 %. Latter example is based on timer.)

User Interface

  • separation of UI controls (color, shape (vector based even?))
  • better UI for brush (see what you get, brush previews)
  • Brush size preview like in sculpt mode

Other Stuff

  • integration of all brush systems?
  • canvas to become rotatable? (need to tweak drawing code for this as current solution won't work. Need to map image texture on plane and use matrix operations to handle transformation. (See Compiz and other OpenGL implementations.))
  • anti-blending mode accessible via shift-lmb? (fast dodge/burn, multiply/screen etc.) This would work just like Sculpt Mode does currently.
  • grid system (should allow easy creation of perspective grids (better as a layer even?), exact requirements are a bit unclear still)
  • selection system (use paintable selection masks here? Basically a selection is just a mask defining how much does a tool affect a pixel. Selection system should also allow different kind of operations such as doing several operations on the selection (stretch based on pivot?). This system should be integrated to node based layer system on some level. -> Allow easy creation of masks to use in it?)
  • hotkeys (f, shift-f to work like in Sculpt Mode)
  • shift-lmb to add lines. This would add a line between last painted location and current location of the mouse cursor.
  • scratchboard panel (can be used to show brush preview. (uses information about last drawn brush stroke for this. Update on brush change.) Works as a palette as well. + may have some other uses (filter previews?))
  • alternative for the pixel paradigm? (real world units?)
  • vector editor (whole separate project!)
  • tools
    • eraser
    • fill
    • gradient
    • clone
    • heal

References

Other Users Ideas

Suggestions/ideas from bydesign

Layers

If the node layer system was done properly it could actually make blender's image editor more powerful than photoshop/gimp's linear layer approach. Here's a few ways it could really shine:

  • non-destructive "filters/adjustment layers" via nodes (blur node, curves, emboss, glow, etc.) - gimp doesn't even have this
  • non-destructive layer transformations (scale, rotate, etc.) could be made using a transform node (gimp definitely doesn't have this) - may require caching
  • parameterized procedural texture layers (via ability to add texture nodes) - these layers may require caching, but photoshop can't even touch this: imagine a clouds node or blend node where parameters can be tweaked on the fly!
  • render layers provide REAL 3d in the images (not like Photoshop CS3's cheap 3d)
  • pynodes would provide a way for people to create custom filters
  • node groups provide layer folders (gimp doesn't have this)
  • shared alpha masks for layers (single alpha mask node linked to multiple layers)

It could also be challenging because being able to add both composite nodes AND texture nodes would be invaluable.

Interface

One nice thing about Photoshop is the ability to make the image fullscreen and hit tab to show/hide the palettes. I love Blender's composite nodes where you can view the image behind the nodes. A beautiful merge of those ideas would be having the image nodes on top of the image in the image window. A shortcut key could show/hide the nodes so you can see to paint/edit the image. Otherwise you'd have to have the nodes visible in a separate window and it would be an inefficient use of space and get pretty annoying.

General

The only negatives that I can think of is that most painting programs have shape and selection tools. Not sure what the best way to implement that would be. Vector shapes could be created as render layers, but that might be cumbersome. I'm sure you'll figure something out.

Keep up the awesome work!

Vilda Novak (based on experience with Blender painting):

Brushes:

  • make rotatable (sculpt brushes have this already) - very important for advanced brushes (splats, detail objects)
  • "fetch brush" tool - take an source image and select an area from it as a brush - similar to clone stamp, but just takes part of the image and links it to the brush texture with proper cropping.
  • make modes like draw, smooth, shear part of the brush preset, maybe call brushes presets or make a new class, which involves a little bit more than just the brush shape. Since brushes are usually made for a certain purpose each (wrinkles, bumps, cracks, smoothing) the selecting of the mode is an additional task which is always the same for a certain brush.
  • use of beautiful new thumbnailing system for brushes?

Layers:

  • adjustment layers, just a simple copy of HSV, brightness/contr.
  • the layering wouldn't have to be linear, but could be net-like like any other node setup, Actually the same like the current node editor is.
  • currently the node system can eat up big amounts of memory - files could be cached on the disc dynamically
  • the node system currently works so that it too much often updates the whole tree. for optimisation, it would be good to have it running only necessary updates.
  • enabling the user to save all layers into 1 file - use of openexr/tiff?

interface:

  • seeing brush simultaneously in 3d view and in imageview, for better orientation