mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-14 11:16:53 -04:00
The 15 warp presets (Edit > Transform > Warp, smart object warps, Warp Text) were our own closed-form approximations, up to 70 px off Photoshop's: Arc kept its centre fixed and pulled the ends in where Photoshop keeps the inner edge's corners and raises the middle, Flag waved the wrong way at a third of the height, Squeeze shrank instead of pinching. Measured on Photoshop 27.11 (scripted renders of a grid image whose colours encode each pixel's position, 102 cases: every preset at bend ±50 and ±100, both distortions, vertical orientation, square, wide and tall boxes), every preset is a single bicubic Bezier patch (fits within 0.5 px). Its control grid: - Arc: each row a circular arc of b·π around one centre, the inner edge keeping its chord; Arch, Bulge, Arc Lower/Upper and Shell built from the same arcs. Circular in pixels on any box. - Flag, Wave, Fish, Rise, Fisheye, Inflate, Squeeze, Twist: control points moved linearly with the bend, in box units. - Vertical distortion scales the top and bottom rows about their midpoints and blends the rows between; horizontal distortion scales each column. Vertical orientation swaps the axes and the two distortions. All 102 cases land within 1 px (median) of Photoshop. On the corpus's Photoshop-made warped text, warp-arc-50 now spans 340x85 at (-3, 3) against Photoshop's 350x88 at (-7, 3), where it was 278x74 at (28, 62). Presets also convert to custom meshes exactly now (to_mesh splits the patch instead of fitting). Tests that pinned the old shapes now assert Photoshop's; presets_match_photoshop checks measured points. Still open: Warp Text warps over our line box, while Photoshop uses the type layer's stored `bounds`; with those the five corpus warp files land within a few px (arc, flag, bulge with distortion, twist, vertical rise). Co-authored-by: Claude Opus 5.5 <[email protected]>