ark-builders / ark-retouch Goto Github PK
View Code? Open in Web Editor NEWQuick image editor for Android
License: MIT License
Quick image editor for Android
License: MIT License
It must be possible to crop borders of a picture. Default mode of operation should be "free" with any aspect ratio of the selection. Should be also possible to use pre-defined ratios, e.g. 1:1 or 3:4. In latter case, sizes of frame sides can be changed by user only consistently, preserving the ratio.
It would be cool to have "time machine" feature: present a user with [timeline]
slider and allow user to move along this slider from the very end to the very beginning and back.
Original image size should be maintained unless the user applies resize or crop (any operation that changes image dimensions)
There seems to be a threshold of minimum amount of dots per line. Probably for avoiding random touches. It results in impossibility to draw dots and symbols involving them (!
or ?
).
Also, when a user attempts to draw a line, it doesn't appear. But the action is still counted. This can be observed during sequence of undo
events. In other words, these dots are invisible and still take a turn to undo them.
We need to solve these 4 issues:
Last 2 issues should involve some matrix operations and composing a final transformation matrix before rendering the image. In other words, if a user turns a picture 8 degrees left, then 20 degrees right, only 1 transformation must be applied to the image written to disk: 12 degrees right. The same with scaling.
Please, create separate pull-requests for each issue. Don't solve #14 and #15 at the same time, make only one merged first and then the second.
#13 and #16 can be done in parallel pull-requests without problem.
What dependencies require Android 9 and higher?
One or many operations can get lost when user opens saving dialog and changes path to store the result.
It seems to not depend on a kind of the operations. Any of drawing, crop or rotation can be lost.
Thickness selector sometimes closes unpredictably, when a bluetooth pen is used. It closes when the pen points at the selector, but not touches the screen (bluetooth-enabled pens allow to point like a mouse).
User must be capable of resizing any image. For now, only the whole image resizing should be supported — resizing of a frame inside the picture should be considered as separate feature. Only down-scaling should be supported for now.
At this moment, editing huge images makes them even bigger because "lossy" compression mode is changed to "lossless".
The blur tool is special mode which would have people to hide sensitive information on their images.
The app displays background as white, but after saving the image it's black (if the resulting file is opened by another app). In fact, the background is transparent which results in different filling in different apps.
The color must be explicit in the code, it should be possible to change it using #6 as well. Transparent should be one of options for the color.
Crop and rotate operations cause quality to slightly drop and this effect accumulates.
Both of these operations must just accumulate some matrix transformation without actual render (except preview).
Rendering must happen only during saving into a file. During this final rendering, all operations must be applied at once if possible. It might be difficult to "sandwich" operations without loss of quality, e.g. crop, rotate, crop
. But if possible to represent such a heterogeneous sequence of operations as a single matrix transformation, that would be perfect.
Sequences like crop, crop, crop
or rotate, rotate, rotate
always can be reduced to a single operation.
Example 1 (original image is 100x100
):
crop(10,10,20,20)
crop(5,5,10,10)
is the same as
crop(15,15,20,20)
Example 2:
rotate(90 degrees)
rotate(-10 degrees)
rotate(40 degrees)
rotate(-20 degrees)
is the same as
rotate(100 degrees)
When we pivot images by 90°, we alternate the layout from portrait to landscape, and vice versa. This ensures no data is lost.
This concept could be extended to any rotation angle. The goal is to keep image data loss to a minimum. That is, reducing the area of image portions that fall outside the image boundaries. We can achieve this by switching layouts not just at a straight 90°, but also for any angle within the 45° — 135° and 225° — 315° ranges.
Rotation mode should include checkbox [use_smart_switching]
When the rotation angle falls within the ranges specified above:
* if [use_smart_switching]
is checked, the layout changes automatically
* if [use_smart_switching]
is unchecked, a [switch_layout]
button appears
* pressing [switch_layout]
changes the layout
Can be even 30 seconds if you are unlucky.
Any image must be possible to rotate:
In any case, matrix transformation must be used. Any amount of rotations must be optimized into single rotation using matrix multiplication. This will preserve image quality as much as possible.
Sometimes, saving is too slow. User is not blocked from doing changes while the image is saved. In case of overwriting save, all new changes will be lost. The easiest way to prevent it is to suspend UI and display spinning animation while save is performed.
We need a logo for this version. Let's just take it from Legacy repo: https://github.com/ARK-Builders/ARK-Retouch-Legacy
When Eraser tool is selected in drawing mode users cannot:
It works like this because we disable any button in the toolbar while a tool is engaged. But Eraser tool is closer to a modification of Drawing mode than to dedicated tools like crop, resize, rotate etc. So we should handle it appropriately and enable some of the buttons (undo/redo, brush width).
Some mobile editors allow putting text pictures. It can be just text or embedded in some bubble for better look.
For this we need a button which creates a bubble and editable text inside. Would be great to be able to change shape and color of the bubble, or just disable the bubble and leave only plain text.
During crop operation: hovering with bluetooth pen above crop area borders causes the borders "float". Really weird effect.
Update:
There is also "acceleration effect" — when border of the crop area is moved quickly, it continues moving after the touch was released.
Filename input lags and keyboard acts strangely.
User must be able to share the result without saving it. E.g. send into messenger or another app.
We have shared component https://github.com/ARK-Builders/ark-filepicker/ which, apart from plain filepicker, also adds navigation by ARK folders registered in the system. It must be convenient to use it to quickly find registered Pictures
"root" or Screenshots
"favorite" folder to save new image there.
Integration example can be taken from https://github.com/ARK-Builders/ARK-Navigator repo.
This feature from Retouch Legacy is very handy.
Color picker should remember last used colors.
Currently the canvas wraps its content, this prevents user from drawing outside the allowed area. But when we zoom in the image doesn't fill the other empty space, it gets cut. We need zoom to fill all the screen area and move to go anywhere on the screen until device edges.
https://github.com/ARK-Builders/ARK-Retouch/assets/87703131/a7b694df-9ca6-4272-9f01-fa5bd76a963a
We should make it clear for a user where background is transparent. E.g. if we create new drawing or load an image with transparency.
So we have this new feature #26 and user is presented by the list of recently used colors.
E.g. user draws something with orange
color, then with blue
color and then with orange
again.
The list would contain this color sequence: orange
, blue
, orange
.
But it would be better to filter duplicates and just have blue
and then orange
in the list.
So, duplicated should be removed from the final list.
Semi-transparent colors make the line to be "made of circles", these circles overlap resulting in wrong color. But if you draw several lines and undo the last one, the first one becomes of correct color. If you save the image, incorrect version is saved (what would be visible before undoing).
See on the picture:
So, in rotation dialog, if user made 1 rotation and want to do new rotation without leaving the dialog, it is triggered only by touching the screen in initial bounds of the image (blue + unpainted zone). Touching the screen in orange zone doesn't trigger rotation. This is counter-intuitive for an average user.
In other words, only initial rectangle is draggable, not current one.
See on the video:
Same as in Legacy version: ARK-Builders/ARK-Retouch-Legacy#14
Functions of new app should as close to https://github.com/ARK-Builders/ARK-Retouch-Legacy as possible. However, code quality of Legacy version is not satisfactory and libraries used are not optimal. We should re-design the app completely using modern dependencies and techniques.
Device rotation configuration change must be handled to preserve all edits, more especially crop and rotate edits.
It should preserve the state of cropping when app is in cropping mode.
It should also preserve the state of rotation when app is in rotation mode.
In continuation of #28:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.