Difference between pages "LGM single window interface" and "Selection + crop tool specification"

From GIMP GUI Redesign
(Difference between pages)
Jump to: navigation, search
 
(fixed width/height/size)
 
Line 1: Line 1:
go back to [[Lgm| LGM issues]]
+
==intro==
  
==our point==
+
This is the specification for the rectangle + oval selection, and the
* improve basic shape
+
crop tools. It is based on the state of GIMP 2.3.13, and is now updated with the realities of 2.3.18.
* allow a SWI with tabs mode
 
  
==argumentation chain==
+
==on units, sizes and visible==
  
* evaluation: we see the inspectors as windows in the window manager/task bar, two menu bars!, inspectors take 440 pixels of width,
+
All sizes in this spec are in '''on-screen pixels'''. This means that the zoom level has an influence on everything. A 30x20 in-image rectangle can be displayed on screen as 300x200, and vice versa.
* first get GIMP into a normal shape: one menu bar, slimmed down inspectors, real palettes, half transparent
 
* result only image window in wm/taskbar, each one matches a user goal
 
* now in a position to discuss SWI WiW
 
* architectural:
 
** it is a solutions trend for this decade
 
** we see a negative side of not-overlapping
 
** we see a negative side of documentation and support will double for this aspect
 
** absolute nr.1 request
 
* GIMP ships standard in improved current shape
 
* with a single menu option can be changed into SWI with tabs for the different images (mock-up), tear off and dock inspectors to the side of the window
 
  
====Raw notes that concern the issue more or less.====
+
Also the panning of the image has an influence on everything. Only the visible part of the bounding rectangle goes into the size calculations. Example: a 123x45 image rectangle is viewed at 1000%, only the left-most 2/3rd and top half of the rectangle is visible in the image window: 820x225 on-screen pixels go into the calculations ( 123*10*2/3 and 45*10/2).
  
=== Icons in the Toolbox ===
+
===decision time===
# it is not easy (=quick) to recognise and identify each icon
 
# should have strong contours, be good metaphors, differentiated by colours
 
# pen and pencil have almost the same angle and colour, at least the colour should be different
 
# better icons which depict the actual effect, are needed for Dodge/burn tool and Eraser
 
# Levels, Curves, Threshold are represented by an icon of their dialog window, not the its meaning & function
 
# all the transformation tools look the same, the colour and blobby shape is the same, just the tiny details differ and show the function
 
# Ink tool would be better represented by an icon of a nib, which is the essence of the tool;
 
# Crop/resize icon is not enough differentiated from the background, and it’s difficult to know what it is; traditional two 'L's (like still used on mouse cursor) is better
 
# Measure icon tool is too complicated, too many details; old one was better (look at [http://docs.gimp.org/en/gimp-tool-measure.html www.docs.gimp.org] )
 
  
=== tool tips===
+
The right moment to recalculate handle sizes and decide if there is a narrow situation shall be '''after''' through zooming, panning or actual bounding rectangle size change, the on-screen pixel size of the bounding rectangle has changed. It is explicitly '''not''' desirable to do this during zooming, panning or actual bounding rectangle size change.
# Initial time-out for the tool tip should be twice as long. So that the tool tip would not show up when you know what you’re doing. Probable the tool tips should come after 2 sec.
 
# There should be tool tips for all the tool parameters.
 
  
===Icons===
+
==handling the bounding rectangle on the canvas==
all transformation icons are almost indistinguishable.
 
  
===Image window issues ===
+
===pending===
#When closing last image window, GIMP should not quit, an 'empty' image window (grey, or with with Wilber, or tooltip) could keep the instance alive.
 
#When minimizing image window also toolbox window(s) should be minimized. (however that might be disturbing when working on many images at  the same time and shifting between them)
 
#In a task bar user should see just the image windows.
 
#Maybe we could dock dialogs in the main image window. User would be able to have separate dialogs all around, or all in image window.
 
#In View/Dialogs menu user could chose the view mode. We should decide about the default after evaluating a mockup of the all-in-one concept.
 
#Inspector (toolbox) windows are at the moment real windows, and in general they are too 'fat' comparedd to the image window. for an optimal working environment they should have more ‘lightweight’ look, trimmer, more ‘athletic’. We need to limit those big push buttons that are common.
 
  
===Toolbox===
+
Between being created and being committed (by means of a single mouse click in its area or the enter/return key), a rectangle is called to be in pending state.
There should be Toolbox categories, a bit of separation would improve the ease of use (speed) of the toolbox. Even 3px between groups of tools would help. No collapsing of groups or labelling. Also in some of the menus we need to introduce more separation lines to speed up the use of them.
 
  
===There are too many options docked in===
+
The algorithm for the size of the corner handles (handle height = bounding rectangle height / 4, CLAMPed by 6 and 50, handle width  = bounding rectangle width  / 4, CLAMPed by 6 and 50) allows fast interaction:
#We need to make assessment what shall be permanently displayed.
 
#What tools will be on a heads-up display, and where would we place that?
 
#Afterwards there is going to be more place for the view of a whole picture.
 
#Things will need to be smaller, we need to think about placing GEGL history, layer, FG/BG color together with user palette, then there is space on the left side: toolbox and tool options.
 
  
==Fragments of Analysis==
+
[[image:2.4_basic_corners.png]]
  
===better behaving windows===
+
what is black in this image shall be rendered inverted on the canvas. ''note that at any time the marching ants of a selection edge can obscure an inverted line.''
  
A definite improvement in the UI must be made by making the toolbox/dialog windows (from now on named inspectors) behave like true floating windows, and not as real content windows. For this the following steps are necessary:
+
Each corner handle shall enable users to resize the bounding rectangle by dragging one of them, where the diagonally opposite corner of the bounding rectangle shall be the anchor point.
  
# Solve that when GIMP is run with no image, that still an image window is shown. this will ensure that for linux and windows platforms there is always a place for the menu bar (singular) to be shown. There is an idea from the GIMP team to show a tip of the day in the otherwise empty window. We consider it an excellent idea to show something that helps in the ease of learning department in an less obstructive (not in a dialog) way.
+
The rectangle cornered by the corner handles shall be the move handle: one big handle where users shall be able to move the bounding rectangle around the canvas by initiating a drag in this handle:
# Merge the menu bar of the toolbox window into the menu bar of the image window.
 
# Give all the inspector windows their proper status, being not a normal window but a floating palette. The important goal here is not to make the inspectors always float on top of image windows, or to make them less chunky—those are just valuable side-effects. It is to keep them out of any window management overviews for users, e.g. the task bar on linux and windows. For the user the only thing that counts (and exists) is working on images, which takes place in image windows. All the inspectors and dialogs do not exist and should not show up when talking about ‘what windows are open?’
 
  
When these changes are made, we confident that actually quite a few traits of
+
[[image:2.4_move_area.png‎]]
current GIMP UI are removed that drive the constant user requests for a single
 
window interface, or WiW.
 
  
===the single window interface, or WiW===
+
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
  
The changes above also will put us on a sound basis to discuss a single window interface.
+
Areas between two adjacent corner handles are called side handles.
  
Interaction architecture, like classical architecture, has trends in the solutions it prefers for a certain problem. And sure enough, the two important, high-end image applications that have entered the market lately—Apple’s aperture and Adobe’s lightroom—sport single window interfaces.
+
The height of the two horizontal side handles shall be exactly the corner handle height, and their width shall be the (bounding rectangle width - 3 * corner handle width), CLAMPed on the lower side by 6.
  
From our point of view there are no negative sides to proving '''also''' a single window interface, except for doubling complication and effort in documentation and support in this area.
+
The width of the two vertical side handles shall be exactly the corner handle width, and their height shall be the (bounding rectangle height - 3 * corner handle height), CLAMPed on the lower side by 6.
  
We believe that the GIMP way of doing things can be that GIMP ships with the default set-up of two inspectors flanking the image window(s). With one single menu item (and not in the preferences dialog) the user could switch on single window mode. This results in an window where the first column (from left) is the toolbox inspector, the second is the image pane (where multiple images appear in tabs), and to the right of this the other inspector(s) in columns. The user has to be able to rearrange the the column order of these by dragging and re-docking, and to be able to tear off any and all of the inspectors to float them again.
+
All side handles shall be exactly centred on the side they are attached to. If the side of the of the bounding rectangle is an odd number of pixels long, then the attached side handle shall be an odd number of pixels long. Similarly: if even, then even. When this adjustment is needed, it shall be done by increasing the handle size by one pixel.
  
===inspectors===
+
[[image:2.4_side_handles.png‎]]
  
Currently the contents of the inspectors is too fat, and not sportif enough.
+
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
The cost of this is screen real estate and an actually permanent part of the
 
interface that is taking too much attention from the image content.
 
  
It is caused by implementing the inspector content with dialog look + feel.
+
This all makes the size of the side handles predictable (and thus faster to use each time) where it counts most (their smallest dimension) and uses their largest dimension to leave a gap to reach the corner handles from within.
One can see from the transient and attention grabbing nature of dialogs versus
 
the permanent and visually integrated nature of inspectors that a different
 
look + feel is necessary.
 
  
We cannot expect the UI guidelines for gNome, KDE or windows to define proper
+
Each side handle shall enable users to resize the bounding rectangle by dragging one of them, moving the side it is attached to, where the mid-point of the opposite side of the bounding rectangle shall be the anchor point.
inspector look + feel when it is Apple who is driving the development in this
 
field and the only platform to fully understand the benefits of inspectors.
 
Therefore some rule-bending and wheel-reinventing will be necessary by the
 
interaction architect on this project. Because of GIMP’s calibre, it will
 
have to push the envelope in this regard.
 
  
But it needs to be done to achieve a leaner and more efficient GIMP UI.
+
What is left within the bounding rectangle are the dead areas, a drag by users starting in these shall do nothing, neither move, nor resize. This is to prevent accidental move when trying to resize, or accidental resize when trying to move:
  
===growing cramps===
+
[[image:2.4_dead_areas.png‎]]
  
The expert evaluation showed that there is no such thing as too big an image
+
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
window. Photographic images are automatically larger that a monitor (or two);
 
as is original art, when produced for print; production of a set of web
 
elements happens together on a canvas; even icon editing gets cramped quickly
 
when working enlarged on the hi-res version.
 
  
GIMP has to support a minimal monitor spec, and the only thing that needs to
+
In the implementation the dead areas shall be used as ‘bumpers’ to reconcile the rounding-off effects in the sizes of the corner and side handles. The dead areas are simply  what is left over in area of the bounding rectangle.
be decided is whether it is a 1024 or 1280 screen laptop. If the user buys a
 
bigger monitor (or even two, not ''that'' common though we observed, among pros) then it
 
is the user who has to profit from this investment, with a larger image window
 
(== working) area, and not GIMP that feels that it can stretch out its UI a
 
bit in this not so cramped surroundings.
 
  
In short, we have to design for a minimal spec, and anything more that users
+
====fixed width/height/size====
got in terms of real estate, is their gain.
 
  
At the moment the two default inspectors eat about 440 pixels of the width of
+
When users are enforcing fixed width or height in the pending state, the rectangle handles shall reflect this. Showing corner handles does not make sense, because only two of the sides can be adjusted. Therefore these two side handles shall be displayed (fixed height, left; fixed width, right):
the screen. Changes mentioned above will already help us in this regard:
 
slimming down inspectors will fight their bulk, and making the inspectors true
 
floating windows will make it realistic for users work with bigger image
 
windows where the inspectors always overlap the window. Both of these will
 
create an enhanced user '''experience''' of having more working space.
 
  
But we need to explore further, into inspectors that—as the user wishes—shrink
+
[[image:2.4_constant_wh_handles.png]]
to 1/3 of their width, and still make. And can automatically expand to
 
full-functioning width when the mouse hovers over them.
 
  
As a second strategy semi-transparency can be explored.
+
With no corner handles to compete with, the side handles shall occupy the whole side of the bounding rectangle. The height
 +
of the top and bottom handles and the width of the left and right handles shall be calculated as usual. The rest of the bounding rectangle area shall be the move handle:
 +
 
 +
[[image:2.4_constant_wh_move.png]]
 +
 
 +
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
 +
 
 +
When users are enforcing fixed size in the pending state, the rectangle handles shall reflect this. Showing corner handles does not make sense. The whole bounding rectangle area shall be one big move handle:
 +
 
 +
[[image:2.4_constant_size_no_handles.png]]
 +
 
 +
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
 +
 
 +
===highlighting===
 +
 
 +
When the sprite (mouse cursor) hovers over a corner handle, it shall highlight by inwardly doubling its perimeter line, and by hiding the other 3 corner handles:
 +
 
 +
[[image:2.4_corner_highlight.png‎]]
 +
 
 +
When the sprite hovers over a side handle, it shall highlight along the whole side of the bounding rectangle with a 1-pixel line, to communicate that it moves the side. The other dimension of the highlight rectangle shall be that of the corresponding side handle. Also there shall be a 2-pixel line along the perimeter of the side handle itself. This is important because this is the only opportunity we have to communicate the size of the handle in a non-obstructive way. The two corner handles on the opposite side shall be hidden:
 +
 
 +
[[image:2.4_side_handles_highlight.png‎]]
 +
 
 +
====fixed width/height====
 +
 
 +
As an implication of enforcing fixed width or height in the pending state, the side handles shall highlight as shown here:
 +
 
 +
[[image:2.4_constant_wh_highlight.png‎]]
 +
 
 +
===rubber-banding===
 +
 
 +
When the mouse goes down inside a corner handle and dragging commences, it shall be displayed and the other 3 hidden, to achieve a minimal-obstruction display:
 +
 
 +
[[image:2.4_corner_drag.png‎]]
 +
 
 +
When the mouse goes down inside a side handle and dragging commences, it shall display a rectangle along the whole side of the bounding rectangle with a 1-pixel line. The other dimension of this rectangle shall be that of the corresponding side handle. The two corner handles on the opposite side shall be hidden:
 +
 
 +
[[image:2.4_side_handles_drag.png‎]]
 +
 
 +
Corner handles shall '''not''' change in size during the rubber-banding of the size of the bounding rectangle. This is necessary to achieve a stable cause-and-effect relationship between the position of the sprite, and the size of the bounding rectangle.
 +
* Side handles shall track the dimension of the bounding rectangle on the side aligned with it, while the other side shall '''not''' change in size during the rubber-banding;
 +
* On creation of a new rectangle, the handle size shall be the minimal handle size;
 +
* When either side of a corner handle, or the not-bounding-rectangle-aligned side of a side handle, is equal or greater that the corresponding side of the bounding rectangle, the handle shall not be displayed during rubber-banding.
 +
 
 +
==cursor keys==
 +
 
 +
The most important thing about enabling cursor keys for moving/resizing the bounding rectangle is that it shall be exactly the same ''user experience'' as performing the same operation with a mouse click. The only exception to this is that when resizing due to a cursor key press, the rubber-banding display shall be skipped.
 +
 
 +
* When the mouse is over one of the corner or side handles, and one of the up/down/right/left cursor keys is pressed, the rectangle shall be resized by one (shift: 15) '''image''' pixel in that direction.
 +
*  When the mouse is over the move handle, and one of the up/down/right/left cursor keys is pressed, the rectangle shall be moved by one (shift: 15) '''image''' pixel in that direction.
 +
 
 +
This interaction is not complete until the goal of keeping the sprite stable on the handle has been achieved. We depend on bug #362915 to be fixed, then we can explore feasible solutions.
 +
 
 +
==think small==
 +
 
 +
Both corner and side handles have a minimum size of 6 pixels. This will work for bounding rectangles down to a size of 18 pixels. Here we see rectangles with one and two dimensions of 18 pixels, also showing the side handles:
 +
 
 +
[[image:2.4_mini_sizes.png]]
 +
 
 +
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
 +
 
 +
If the size of one of the sides of the bounding rectangle is below 18 pixels, we have a '''narrow situation'''. This can be caused by actually narrow-sized bounding rectangles, but also by zooming out and panning out of view. The obvious work-arounds for this (zoom in, pan in) are productivity eaters, we need a real solution.
 +
 
 +
Move the handles outside. Here we see rectangles with one and two dimensions of 17 pixels:
 +
 
 +
[[image:2.4_maxi_narrow.png]]
 +
 
 +
In a narrow situation, the following specs change:
 +
 
 +
* The corner handle size shall be 15x15 pixels, always.
 +
* If the the bounding rectangle has a non-narrow side, the long side of the side handle shall be (bounding rectangle side length - 2 * 15), CLAMPed on the lower side by 18, the short side of the side handle shall be 15 pixels.
 +
* On the narrow sides, the size handles shall simply fill the space between the two corner handles:
 +
 
 +
[[image:2.4_narrow_side_handles.png‎‎]]
 +
 
 +
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
 +
 
 +
There shall be only dead areas on a non-narrow side:
 +
 
 +
[[image:2.4_narrow_dead_areas.png]]
 +
 
 +
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
 +
 
 +
The move handle shall be equal to the bounding rectangle:
 +
 
 +
[[image:2.4_narrow_move_handle.png]]
 +
 
 +
''the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP''
 +
 
 +
Highlighting is unchanged:
 +
 
 +
[[image:2.4_narrow_highlight.png]]
 +
 
 +
As is dragging:
 +
 
 +
[[image:2.4_narrow_drag.png]]
 +
 
 +
==interaction with the canvas edge==
 +
 
 +
In general it shall be possible to start a crop/selection rectangle outside the canvas, or to take the edges of the bounding rectangle outside the canvas. Below is specified what happens in these cases:
 +
 
 +
===selection tools===
 +
 
 +
When one or more edges of the bounding rectangle is outside the canvas, then the canvas edge shall clip the effective selection. The interaction shall reflect this by showing the bounding rectangle in whatever size and position that users take it and the effective selection marching ants along the canvas edge where clipped. Especially with the elliptic select tool, this is part of creative workflow.
 +
 
 +
''However:''
 +
 
 +
* If users enforce a fixed ratio of the bounding rectangle and one or more edges of the bounding rectangle is outside the canvas, then all of these edges shall be aligned with the corresponding canvas edges, and the from the resulting new bounding rectangle sizes the ratio enforcement shall be calculated. The interaction shall reflect this by showing the bounding rectangle in the newly calculated position;
 +
* If users enforce a fixed width of the bounding rectangle and the left or right edge of the bounding rectangle is outside the canvas, then this edge shall be aligned with the corresponding canvas edges, and the from the resulting new bounding rectangle sizes the width enforcement shall be calculated. The interaction shall reflect this by showing the bounding rectangle in the newly calculated position; if the fixed width is greater than the actual canvas width, then the full width of the canvas shall be used;
 +
* If users enforce a fixed height of the bounding rectangle and the top or bottom edge of the bounding rectangle is outside the canvas, then this edge shall be aligned with the corresponding canvas edges, and the from the resulting new bounding rectangle sizes the height enforcement shall be calculated. The interaction shall reflect this by showing the bounding rectangle in the newly calculated position; if the fixed height is greater than the actual canvas height, then the full height of the canvas shall be used;
 +
 
 +
===crop tool===
 +
 
 +
When the 'allow growing' option has been invoked by users, then the crop tool shall be in no way limited by the canvas or layer edge. In the other case:
 +
 
 +
When one or more edges of the bounding rectangle is outside the canvas, then all of these edges shall be aligned with the corresponding canvas edges. The interaction shall reflect this by showing the bounding rectangle in the newly aligned position.
 +
 
 +
For fixed ratio/width/height: see selection tools above.
 +
 
 +
If the 'Current layer only' option has been invoked by users, then all all behaviour specified above shall apply, substituting the layer (edge) for the canvas (edge).
 +
 
 +
==the fixed ratio/widht/height/size and the shift key==
 +
 
 +
Between the 'Expand from centre' and Highlight checkbox there shall be the Fixed ratio/width/height/size control:
 +
 
 +
[[Image:2.4_constant_ratio_control.png]]
 +
 
 +
It is a checkbox, with ('''new''') a pop-up list in the first row, combined with a single textfield and two icons (portrait; landscape) in the second row. The pop-up list shall contain the items 'Aspect ratio', Width, Height, Size, in that order. The default shall be 'Aspect ratio'.
 +
 
 +
The width and height modes shall not display the icons:
 +
 
 +
[[Image:2.4_constant_wh_controls.png]]
 +
 
 +
The size mode is most identical to the ratio mode:
 +
 
 +
[[image:2.4_constant_size_controls.png]]
 +
 
 +
===textfield input===
 +
 
 +
It is extremely important that the textfield shall be a single textfield with no up/down arrows. This allows for quicker input.
 +
 
 +
* in ratio mode, the textfield shall accept the formats A/B and A:B, where A and B are two floating point numbers;
 +
* in width and height modes, the textfield shall accept a single floating point number;
 +
* in size mode, the textfield shall accept the formats A*B, AXB and AxB, where A and B are two floating point numbers. A shall be the width, B shall be the height.
 +
 
 +
Before parsing the input, all white space characters shall be stripped out. The input shall be committed by a <return>, <enter> or a input focus change out of the textfield and shall be one of three kinds:
 +
 
 +
# unambiguous user value; User override state shall be entered for this particular mode (ratio, size, etc.) for all images, for the rest of the session; the user entered value shall be used for this mode;
 +
# unambiguous user clear; apart from that stripped out white space, nothing else was entered in the textfield; this shall enter the default state for this particular mode (ratio, size, etc.) for all images, for the rest of the session; the default value shall be displayed and used for this mode;
 +
# anything else is ambiguous; no state or value change shall be undertaken; the value displayed before users' text input shall be restored.
 +
 
 +
Default values:
 +
 
 +
* in ratio mode, the default value for the textfield shall be "1:1" for the selection tools; for the crop tool it shall be <current layer/canvas width>:<current layer/canvas height> when there is no pending crop rectangle and <crop rectangle width >:<crop rectangle height> when there is a pending crop rectangle; this value shall not change during rubber-banding;
 +
* in width mode, the default value for the textfield shall be <current layer/canvas width>;
 +
* in height mode, the default value for the textfield shall be <current layer/canvas height>;
 +
* in size mode, the default  value for the textfield shall be "100x100", ''[this is a random value, I am open for suggestions for a more useful default here].''
 +
 
 +
====mathematician's Easter egg====
 +
 
 +
In ratio mode, when the users' input is terminated with a '=' character, the entered ratio shall be simplified to the to lowest integer numbers that faithfully represent the ratio. The '=' character shall not be displayed after siplification. Both the entered ratio and the resulting simplified ratio shall be added as user input for auto-completion.
 +
 
 +
====auto-completion====
 +
 
 +
The textfield shall have auto-completion, Firefox URL-field style. In ratio mode, '/' and ':' shall be treated as fully equivalent. In size mode, '*', 'x' and 'X' shall be treated as fully equivalent. That means that is one is typed, it shall match any other in the previous user input. Only unambiguous user input shall be stored for auto completion re-use for the particular mode. It shall be persisted for a week after being entered or being re-used.
 +
 
 +
===checkbox and the shift key===
 +
 
 +
When the checkbox is checked, the constraint that is set by the user with the ratio/width/height/size pop-up list shall be enforced while rubber-banding a rectangle. Pressing the shift key while rubber-banding shall toggle the checkbox in the other state. Only users shall be able to explicitly toggle the checkbox directly or with the shift key. Under '''no circumstance''' shall GIMP itself ''get smart'' and toggle the checkbox, particularly not as a result of users entering or clearing text in the textbox.
 +
 
 +
The two icons shall be just icons, not inside pushbuttons like in the New file dialog. '''No state''' shall be reflected by the icons. this just leads to unnecessary noise in the interface. Clicking one of the icons shall simply enforce portrait or landscape in the textfield by swapping the two number values when necessary.
 +
 
 +
===tool options===
 +
 
 +
From all three tool option panels, all the Fix buttons shall be removed.
 +
 
 +
The Width field shall be greyed-out when either fixed width or fixed size is enforced by the user. The Height field shall be greyed-out when either fixed height or fixed size is enforced by the user.
 +
 
 +
All lines that contain textfields shall be sized such that they just fit inside a tool option panel that is 6 tool icons wide (the default).
 +
 
 +
The guides pop-up menu left side shall be aligned with the left sides of the checkboxes, the pop-up menu right side shall be aligned with the left sides of the textfields.
 +
 
 +
For the crop tool there shall be a new checkbox in the options panel: 'allow growing' (default: unchecked). Normally limiting cropping to the exact edges of the layer/canvas has the highest priority, hence the rules above. This checkbox overrides that, and the layer/canvas can be size up by dragging a bigger rectangle around it.
 +
 
 +
===highlight/darkening of the crop tool===
 +
 
 +
Even when the Highlight checkbox is checked, the darkening
 +
effect shall not be displayed during rubber-banding. This
 +
allows for precise adjustments.

Revision as of 11:34, 1 August 2007

intro

This is the specification for the rectangle + oval selection, and the crop tools. It is based on the state of GIMP 2.3.13, and is now updated with the realities of 2.3.18.

on units, sizes and visible

All sizes in this spec are in on-screen pixels. This means that the zoom level has an influence on everything. A 30x20 in-image rectangle can be displayed on screen as 300x200, and vice versa.

Also the panning of the image has an influence on everything. Only the visible part of the bounding rectangle goes into the size calculations. Example: a 123x45 image rectangle is viewed at 1000%, only the left-most 2/3rd and top half of the rectangle is visible in the image window: 820x225 on-screen pixels go into the calculations ( 123*10*2/3 and 45*10/2).

decision time

The right moment to recalculate handle sizes and decide if there is a narrow situation shall be after through zooming, panning or actual bounding rectangle size change, the on-screen pixel size of the bounding rectangle has changed. It is explicitly not desirable to do this during zooming, panning or actual bounding rectangle size change.

handling the bounding rectangle on the canvas

pending

Between being created and being committed (by means of a single mouse click in its area or the enter/return key), a rectangle is called to be in pending state.

The algorithm for the size of the corner handles (handle height = bounding rectangle height / 4, CLAMPed by 6 and 50, handle width = bounding rectangle width / 4, CLAMPed by 6 and 50) allows fast interaction:

2.4 basic corners.png

what is black in this image shall be rendered inverted on the canvas. note that at any time the marching ants of a selection edge can obscure an inverted line.

Each corner handle shall enable users to resize the bounding rectangle by dragging one of them, where the diagonally opposite corner of the bounding rectangle shall be the anchor point.

The rectangle cornered by the corner handles shall be the move handle: one big handle where users shall be able to move the bounding rectangle around the canvas by initiating a drag in this handle:

2.4 move area.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

Areas between two adjacent corner handles are called side handles.

The height of the two horizontal side handles shall be exactly the corner handle height, and their width shall be the (bounding rectangle width - 3 * corner handle width), CLAMPed on the lower side by 6.

The width of the two vertical side handles shall be exactly the corner handle width, and their height shall be the (bounding rectangle height - 3 * corner handle height), CLAMPed on the lower side by 6.

All side handles shall be exactly centred on the side they are attached to. If the side of the of the bounding rectangle is an odd number of pixels long, then the attached side handle shall be an odd number of pixels long. Similarly: if even, then even. When this adjustment is needed, it shall be done by increasing the handle size by one pixel.

2.4 side handles.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

This all makes the size of the side handles predictable (and thus faster to use each time) where it counts most (their smallest dimension) and uses their largest dimension to leave a gap to reach the corner handles from within.

Each side handle shall enable users to resize the bounding rectangle by dragging one of them, moving the side it is attached to, where the mid-point of the opposite side of the bounding rectangle shall be the anchor point.

What is left within the bounding rectangle are the dead areas, a drag by users starting in these shall do nothing, neither move, nor resize. This is to prevent accidental move when trying to resize, or accidental resize when trying to move:

2.4 dead areas.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

In the implementation the dead areas shall be used as ‘bumpers’ to reconcile the rounding-off effects in the sizes of the corner and side handles. The dead areas are simply what is left over in area of the bounding rectangle.

fixed width/height/size

When users are enforcing fixed width or height in the pending state, the rectangle handles shall reflect this. Showing corner handles does not make sense, because only two of the sides can be adjusted. Therefore these two side handles shall be displayed (fixed height, left; fixed width, right):

2.4 constant wh handles.png

With no corner handles to compete with, the side handles shall occupy the whole side of the bounding rectangle. The height of the top and bottom handles and the width of the left and right handles shall be calculated as usual. The rest of the bounding rectangle area shall be the move handle:

2.4 constant wh move.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

When users are enforcing fixed size in the pending state, the rectangle handles shall reflect this. Showing corner handles does not make sense. The whole bounding rectangle area shall be one big move handle:

2.4 constant size no handles.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

highlighting

When the sprite (mouse cursor) hovers over a corner handle, it shall highlight by inwardly doubling its perimeter line, and by hiding the other 3 corner handles:

2.4 corner highlight.png

When the sprite hovers over a side handle, it shall highlight along the whole side of the bounding rectangle with a 1-pixel line, to communicate that it moves the side. The other dimension of the highlight rectangle shall be that of the corresponding side handle. Also there shall be a 2-pixel line along the perimeter of the side handle itself. This is important because this is the only opportunity we have to communicate the size of the handle in a non-obstructive way. The two corner handles on the opposite side shall be hidden:

2.4 side handles highlight.png

fixed width/height

As an implication of enforcing fixed width or height in the pending state, the side handles shall highlight as shown here:

2.4 constant wh highlight.png

rubber-banding

When the mouse goes down inside a corner handle and dragging commences, it shall be displayed and the other 3 hidden, to achieve a minimal-obstruction display:

2.4 corner drag.png

When the mouse goes down inside a side handle and dragging commences, it shall display a rectangle along the whole side of the bounding rectangle with a 1-pixel line. The other dimension of this rectangle shall be that of the corresponding side handle. The two corner handles on the opposite side shall be hidden:

2.4 side handles drag.png

Corner handles shall not change in size during the rubber-banding of the size of the bounding rectangle. This is necessary to achieve a stable cause-and-effect relationship between the position of the sprite, and the size of the bounding rectangle.

  • Side handles shall track the dimension of the bounding rectangle on the side aligned with it, while the other side shall not change in size during the rubber-banding;
  • On creation of a new rectangle, the handle size shall be the minimal handle size;
  • When either side of a corner handle, or the not-bounding-rectangle-aligned side of a side handle, is equal or greater that the corresponding side of the bounding rectangle, the handle shall not be displayed during rubber-banding.

cursor keys

The most important thing about enabling cursor keys for moving/resizing the bounding rectangle is that it shall be exactly the same user experience as performing the same operation with a mouse click. The only exception to this is that when resizing due to a cursor key press, the rubber-banding display shall be skipped.

  • When the mouse is over one of the corner or side handles, and one of the up/down/right/left cursor keys is pressed, the rectangle shall be resized by one (shift: 15) image pixel in that direction.
  • When the mouse is over the move handle, and one of the up/down/right/left cursor keys is pressed, the rectangle shall be moved by one (shift: 15) image pixel in that direction.

This interaction is not complete until the goal of keeping the sprite stable on the handle has been achieved. We depend on bug #362915 to be fixed, then we can explore feasible solutions.

think small

Both corner and side handles have a minimum size of 6 pixels. This will work for bounding rectangles down to a size of 18 pixels. Here we see rectangles with one and two dimensions of 18 pixels, also showing the side handles:

2.4 mini sizes.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

If the size of one of the sides of the bounding rectangle is below 18 pixels, we have a narrow situation. This can be caused by actually narrow-sized bounding rectangles, but also by zooming out and panning out of view. The obvious work-arounds for this (zoom in, pan in) are productivity eaters, we need a real solution.

Move the handles outside. Here we see rectangles with one and two dimensions of 17 pixels:

2.4 maxi narrow.png

In a narrow situation, the following specs change:

  • The corner handle size shall be 15x15 pixels, always.
  • If the the bounding rectangle has a non-narrow side, the long side of the side handle shall be (bounding rectangle side length - 2 * 15), CLAMPed on the lower side by 18, the short side of the side handle shall be 15 pixels.
  • On the narrow sides, the size handles shall simply fill the space between the two corner handles:

2.4 narrow side handles.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

There shall be only dead areas on a non-narrow side:

2.4 narrow dead areas.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

The move handle shall be equal to the bounding rectangle:

2.4 narrow move handle.png

the gray area shown here is purely for illustration in this spec and shall not be rendered in GIMP

Highlighting is unchanged:

2.4 narrow highlight.png

As is dragging:

2.4 narrow drag.png

interaction with the canvas edge

In general it shall be possible to start a crop/selection rectangle outside the canvas, or to take the edges of the bounding rectangle outside the canvas. Below is specified what happens in these cases:

selection tools

When one or more edges of the bounding rectangle is outside the canvas, then the canvas edge shall clip the effective selection. The interaction shall reflect this by showing the bounding rectangle in whatever size and position that users take it and the effective selection marching ants along the canvas edge where clipped. Especially with the elliptic select tool, this is part of creative workflow.

However:

  • If users enforce a fixed ratio of the bounding rectangle and one or more edges of the bounding rectangle is outside the canvas, then all of these edges shall be aligned with the corresponding canvas edges, and the from the resulting new bounding rectangle sizes the ratio enforcement shall be calculated. The interaction shall reflect this by showing the bounding rectangle in the newly calculated position;
  • If users enforce a fixed width of the bounding rectangle and the left or right edge of the bounding rectangle is outside the canvas, then this edge shall be aligned with the corresponding canvas edges, and the from the resulting new bounding rectangle sizes the width enforcement shall be calculated. The interaction shall reflect this by showing the bounding rectangle in the newly calculated position; if the fixed width is greater than the actual canvas width, then the full width of the canvas shall be used;
  • If users enforce a fixed height of the bounding rectangle and the top or bottom edge of the bounding rectangle is outside the canvas, then this edge shall be aligned with the corresponding canvas edges, and the from the resulting new bounding rectangle sizes the height enforcement shall be calculated. The interaction shall reflect this by showing the bounding rectangle in the newly calculated position; if the fixed height is greater than the actual canvas height, then the full height of the canvas shall be used;

crop tool

When the 'allow growing' option has been invoked by users, then the crop tool shall be in no way limited by the canvas or layer edge. In the other case:

When one or more edges of the bounding rectangle is outside the canvas, then all of these edges shall be aligned with the corresponding canvas edges. The interaction shall reflect this by showing the bounding rectangle in the newly aligned position.

For fixed ratio/width/height: see selection tools above.

If the 'Current layer only' option has been invoked by users, then all all behaviour specified above shall apply, substituting the layer (edge) for the canvas (edge).

the fixed ratio/widht/height/size and the shift key

Between the 'Expand from centre' and Highlight checkbox there shall be the Fixed ratio/width/height/size control:

2.4 constant ratio control.png

It is a checkbox, with (new) a pop-up list in the first row, combined with a single textfield and two icons (portrait; landscape) in the second row. The pop-up list shall contain the items 'Aspect ratio', Width, Height, Size, in that order. The default shall be 'Aspect ratio'.

The width and height modes shall not display the icons:

2.4 constant wh controls.png

The size mode is most identical to the ratio mode:

2.4 constant size controls.png

textfield input

It is extremely important that the textfield shall be a single textfield with no up/down arrows. This allows for quicker input.

  • in ratio mode, the textfield shall accept the formats A/B and A:B, where A and B are two floating point numbers;
  • in width and height modes, the textfield shall accept a single floating point number;
  • in size mode, the textfield shall accept the formats A*B, AXB and AxB, where A and B are two floating point numbers. A shall be the width, B shall be the height.

Before parsing the input, all white space characters shall be stripped out. The input shall be committed by a <return>, <enter> or a input focus change out of the textfield and shall be one of three kinds:

  1. unambiguous user value; User override state shall be entered for this particular mode (ratio, size, etc.) for all images, for the rest of the session; the user entered value shall be used for this mode;
  2. unambiguous user clear; apart from that stripped out white space, nothing else was entered in the textfield; this shall enter the default state for this particular mode (ratio, size, etc.) for all images, for the rest of the session; the default value shall be displayed and used for this mode;
  3. anything else is ambiguous; no state or value change shall be undertaken; the value displayed before users' text input shall be restored.

Default values:

  • in ratio mode, the default value for the textfield shall be "1:1" for the selection tools; for the crop tool it shall be <current layer/canvas width>:<current layer/canvas height> when there is no pending crop rectangle and <crop rectangle width >:<crop rectangle height> when there is a pending crop rectangle; this value shall not change during rubber-banding;
  • in width mode, the default value for the textfield shall be <current layer/canvas width>;
  • in height mode, the default value for the textfield shall be <current layer/canvas height>;
  • in size mode, the default value for the textfield shall be "100x100", [this is a random value, I am open for suggestions for a more useful default here].

mathematician's Easter egg

In ratio mode, when the users' input is terminated with a '=' character, the entered ratio shall be simplified to the to lowest integer numbers that faithfully represent the ratio. The '=' character shall not be displayed after siplification. Both the entered ratio and the resulting simplified ratio shall be added as user input for auto-completion.

auto-completion

The textfield shall have auto-completion, Firefox URL-field style. In ratio mode, '/' and ':' shall be treated as fully equivalent. In size mode, '*', 'x' and 'X' shall be treated as fully equivalent. That means that is one is typed, it shall match any other in the previous user input. Only unambiguous user input shall be stored for auto completion re-use for the particular mode. It shall be persisted for a week after being entered or being re-used.

checkbox and the shift key

When the checkbox is checked, the constraint that is set by the user with the ratio/width/height/size pop-up list shall be enforced while rubber-banding a rectangle. Pressing the shift key while rubber-banding shall toggle the checkbox in the other state. Only users shall be able to explicitly toggle the checkbox directly or with the shift key. Under no circumstance shall GIMP itself get smart and toggle the checkbox, particularly not as a result of users entering or clearing text in the textbox.

The two icons shall be just icons, not inside pushbuttons like in the New file dialog. No state shall be reflected by the icons. this just leads to unnecessary noise in the interface. Clicking one of the icons shall simply enforce portrait or landscape in the textfield by swapping the two number values when necessary.

tool options

From all three tool option panels, all the Fix buttons shall be removed.

The Width field shall be greyed-out when either fixed width or fixed size is enforced by the user. The Height field shall be greyed-out when either fixed height or fixed size is enforced by the user.

All lines that contain textfields shall be sized such that they just fit inside a tool option panel that is 6 tool icons wide (the default).

The guides pop-up menu left side shall be aligned with the left sides of the checkboxes, the pop-up menu right side shall be aligned with the left sides of the textfields.

For the crop tool there shall be a new checkbox in the options panel: 'allow growing' (default: unchecked). Normally limiting cropping to the exact edges of the layer/canvas has the highest priority, hence the rules above. This checkbox overrides that, and the layer/canvas can be size up by dragging a bigger rectangle around it.

highlight/darkening of the crop tool

Even when the Highlight checkbox is checked, the darkening effect shall not be displayed during rubber-banding. This allows for precise adjustments.