Skip to content

Commit 6bfe841

Browse files
committed
Image > Crop: total overhaul
PhotoDemon's Image > Crop function was due for an overhaul. A number of long-standing bugs have been fixed, particularly when cropping layers with large amounts of transparent padding. Perhaps most exciting, I have cut the memory usage of cropping by more than 50% on both single-layer and multi-layer images. Previously, a temporary scratch layer was used for all crop compositing (which can be a complex process, depending on the underlying selection shape), but PhotoDemon no longer requires this. Instead, cropping is now performed in stages, starting with a partial copy directly into the new target layer. The crop result is then composited directly atop this, skipping the need for any intermediary copies. (A nice bonus of this is improved performance, too.) As noted in a previous commit, I've also reworked the way normal rectangular crops behave. These are the most common type of crop, obviously, and they will now preserve editable text layers instead of rasterizing them. This required some new interplay between the crop engine and PD's central processor, but I think the end result is pretty great! This work will also make a future dedicated on-canvas Crop tool easier to implement.
1 parent f8c10b1 commit 6bfe841

File tree

3 files changed

+215
-198
lines changed

3 files changed

+215
-198
lines changed

0 commit comments

Comments
 (0)