Commit Graph

135 Commits

Author SHA1 Message Date
Gaspar Capello 2f22804fe8 Fix GIF animations with semi-transparent colors (fix #5226)
Prior to this fix, animations were incorrectly converted to GIF when
the animation contained semi-transparent colors or backgrounds
(specifically, colors with alpha <= 128). Essentially, semi-transparent
pixels didn't repaint the pixel of the processed frame, meaning they
retained the color from the previous frame.
2025-07-07 17:43:19 -03:00
David Capello 09538f9a1a clang-format all files 2024-12-16 14:52:19 -03:00
Martín Capello 16f3e53ce9 Add flag to avoid creating backround layers
Now callers can force loading a file without creating any background
layer in the doc. This is because for drag and drop operations we don't
want to generate background layers
2024-10-15 16:24:41 -03:00
David Capello bf0a47545c Remove #if/endif ENABLE_UI conditional directives (fix #4619)
This was originated for #1279 (CLI-only Aseprite) which can be
achieved with LAF_BACKEND=none anyway.

In this way we simplify the development process, and checking for the
availability of the GUI can be done in run-time through App::isGui()
or Context::isUIAvailable().
2024-09-02 23:16:26 -03:00
Martín Capello eb45c4adf5 Add support to "play subtags & repetitions" when exporting an animation (fix #4173) 2024-02-02 17:52:58 -03:00
Gaspar Capello e9f078e66e Fix error decoding pico-8 GIFs (fix #3922) 2023-07-18 20:55:32 -03:00
David Capello 35e64ad2f3 Fix exporting selection to gif/fli/webp files (fix #3827) 2023-07-11 13:33:45 -03:00
Gaspar Capello 18c56ae638 Add frame duration warnings saving animated GIF files (fix #1504) 2023-03-20 12:55:34 -03:00
Gaspar Capello fbf62407d3 Fix gif opening causes color reindexing when duplicate colors in color table (fix #3426)
If the RGB color at index 'i' of the local gif palette and the sprite palette match, there is no need to call findMatchColor(). This prevents indexes from being reassigned undesirably.
Also, in the special case that a global palette exists and as long as no local palette appears during frame iteration, it is not necessary to call findMatchColor() since the global palette is equal to the sprite's palette (in colors and order).
2022-09-20 13:52:15 -03:00
David Capello caf475b2dc Merge branch 'main' into beta 2022-06-15 13:44:34 -03:00
David Capello 4aa5fedfec New "on the fly" resize when saving/exporting image (fix #1112)
Implemented using a new FileAbstractImage interface to get scanlines
for each frame automatically resized (without modifying the original
sprite/without using SpriteSize command/adding new undo information).

Related to #3008
2022-06-14 23:19:39 -03:00
Gaspar Capello 10a5694e6e Fix regression saving certain GIF files when disposing frames (fix #2806)
Before this fix, when some aseprite file with transparents pixels was
converted to GIF, each frame didn't overwrite correctly the previous
frame (image disposal was incorretly chosen: DO_NOT_DISPOSE instead of
RESTORE_BGCOLOR).
2021-07-12 11:00:54 -03:00
Gaspar Capello bec5a14e22 Change octree quantization is the new palette creation method on gif format coding/decoding 2021-06-07 18:01:27 -03:00
David Capello 515dace441 Merge branch 'beta' into tilemap-editor 2020-07-13 17:32:42 -03:00
Gaspar Capello b7f1555eb3 Fix crash gif decoding
Before this fix, it were read memory positions beyond the end of the local colormap in the function GifMakeMapObject.
2020-07-07 16:35:09 -03:00
David Capello 4e896b8a65 Merge branch 'fix-gif' into beta 2020-06-17 23:52:49 -03:00
David Capello bcf53fa54a Merge branch 'octree' into beta 2020-06-17 23:33:41 -03:00
Gaspar Capello 95d4e767e4 Fix gif encoding crash
Before this fix, during gif encoding we get a crash when the previous and current frames matchs exactly and no pixel clearing are detected from a frame to the next.
We arrive to this situation during the gif encode main iteration which calculates deltaImage and its frameBounds.
2020-06-09 17:06:03 -03:00
Gaspar Capello f6128790d1 Fix gif decoder, sometimes some colors were missing in the palette
Before this fix, some colors were missing in the palette when gif animation were open.
The conditions to reproduce the error are:
  - Final open sprite is not opaque,
  - Gif source without a global colorMap and
  - Gif source with different local transparent indices for each frame
2020-06-03 15:28:51 -03:00
David Capello a80af2b304 Merge branch 'master' into tilemap-editor 2020-05-18 20:24:22 -03:00
Gaspar Capello af7e85313a Fix gif encoder, blended indexed images could be selected to preserve palette orders, but it is not possible.
Before this fix, multi layer blended indexed images (into the gif options dialog), could be checked in the preserve palette orders check box, but actually it is not possible.
In addition, we bypass large code blocks when we have to preserve palette order.
2020-04-22 11:23:16 -03:00
David Capello 1f34d0e46e Add different formulas to convert RGB to Grayscale 2020-04-20 10:22:41 -03:00
David Capello 8d7020a063 GifDecoder: Minor change to trace more info per frame w/GIF_TRACE() 2020-04-16 08:53:56 -03:00
Gaspar Capello ecca4a7822 Fix color scan area in delta image when the color count surpass the gif specifications 2020-04-13 09:54:32 -03:00
Gaspar Capello 886fdf8b3f Add OctreeMap as an alternative RgbMap implementation to RgbMapRGB53A
There is a new experimental option to switch between both RgbMap
implementations.
2020-04-10 15:47:24 -03:00
David Capello ad31c9b7a8 Convert RgbMap into an interface and rename the old class to RgbMapRGB53A 2020-04-10 10:15:04 -03:00
Gaspar Capello 43b029391f Fix an error and infinite loop when RGB image is over the gif specification color count. 2020-04-09 10:24:59 -03:00
David Capello b007c4dd0e Minor changes/comments to new gif encoder 2020-04-09 10:24:24 -03:00
Gaspar Capello 7ed83c10cc Fix gif format encoding 2020-04-09 10:23:36 -03:00
David Capello b628e21e76 Replace MIN/MAX() macros with std::min/max() functions 2020-04-08 12:20:53 -03:00
David Capello 26139c4ae2 Add tilemap layers (#977)
This is the first commit with a simple tilemap editor. Still buggy but
functional in several ways. Several changes were made:

* NewLayer command can receive a tilemap=true to create a new tilemap
  layer
* New ToggleTilesMode command added to switch between the palette and
  the tileset in the ColorBar (the ColorBar was expanded to show
  colors or tilesets with a generic AbstractPaletteViewAdapter)
* All commands to create new layers were moved to Layer >
  New... submenu
* There are a new tileset chunk to save tilesets in .aseprite files,
  and a new kind of cels to save tilemaps
* Added doc::LayerTilemap, doc::Tileset, etc. and several other types
  to handle tilesets/tilemaps in the doc layer.
* Added doc::Grid class with grid specifications that indicates how a
  tilemap <-> tileset must be drawn
* Added and expanded cel operations to work with tilemaps and
  conversions between regular LayerImage cels <-> LayerTilemap cels
  (e.g. copy cels in the timeline between layer types)
2020-02-17 09:06:00 -03:00
David Capello d8b933c3f1 Load GIF files w/pixels outside the canvas bounds anyway (fix #2211) 2019-12-03 09:33:30 -03:00
David Capello 6fff771118 Fix crash using mismatch of FormatOptions (fix #2130) 2019-08-01 20:20:02 -03:00
David Capello d32fd97da5 Replace base::SharedPtr with std::shared_ptr
We can remove our smart pointer (base::SharedPtr) as we're already
using C++11 compilers on all platforms.
2019-08-01 19:16:16 -03:00
David Capello 07077c139d Don't print TRACE() output by default from gif_format.cpp 2019-06-05 10:30:18 -03:00
David Capello 109e6fa205 Add render::Dithering() class to store all dithering parameters 2019-04-03 19:32:24 -03:00
David Capello fcf272bb69 Add amount parameter to Error Diffusion algorithm 2019-04-03 18:45:18 -03:00
David Capello c6fb34ef4a Don't access newBlend preference from background threads
Continuation of 673e1955fa
2019-04-01 15:29:48 -03:00
Gaspar Capello f53544842c Fix non-normal blend modes when the backdrop is transparent (fix #1096) 2019-03-09 12:40:31 -03:00
David Capello 81965b904f Use current working color space in new created files
* Added the gfx::ColorSpace field in doc::ImageSpec
* Removed some methods like Sprites::add(width, height, etc.)
* Prefer methods with ImageSpec as argument (which now includes the color space)
2018-10-25 15:23:01 -03:00
David Capello a4d8fc52bf Manage color profiles (fix #1576) 2018-10-19 15:30:30 -03:00
David Capello f2ed45e795 Replace base::UniquePtr -> std::unique_ptr 2018-08-08 17:27:26 -03:00
David Capello 9c79ea2b77 Rename app::Document -> Doc 2018-07-07 11:54:44 -03:00
David Capello b015fee8e0 Add a semi-transparent pixel (alpha=254) when export png for Twitter 2018-06-25 15:58:28 -03:00
David Capello 139c5aac49 Add flag to compile CLI-only (fix #1279)
New cmake flag -DENABLE_UI=OFF can be used to turn off the GUI
and compile a CLI-only version of Aseprite.

Requested here too:
https://community.aseprite.org/t/1351
2018-05-07 00:11:50 -03:00
David Capello 1fb463f931 Add option to export GIF for Twitter (#1220, #1252) 2018-03-16 11:03:50 -03:00
David Capello d5cfe5123e win: Flush file content on disk after saving a sprite
Possible fix for this issue:
https://community.aseprite.org/t/file-full-of-null-bytes/31
2018-03-07 18:01:33 -03:00
David Capello dee6ff6c7e Refactor: Use new base::paths type for list of filenames/extensions 2018-02-21 11:06:58 -03:00
David Capello b5dc3d263e Add options to suppress specific warnings (fix #917) 2018-02-07 14:35:12 -03:00
David Capello e14b4caa78 GifEncoder: replace get/put_pixe_fast with iterators 2017-09-26 17:58:55 -03:00