Change pixel size of "LA", "La", and "PA" from 4 to 2
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
- #6540 von @Yay295 — ohne Merge geschlossen
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Refactoring
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Bereich
- computer-graphics
Rechercherichtung
Start by tracing ImagingNewPrologueSubtype() in src/libImaging/Storage.c and ImagingAccessInit() in src/libImaging/Access.c, then follow the listed LA, La, and PA handling across the C files and src/PIL/PyAccess.py. Confirm that the modes use a two-byte pixel size, image8 storage, and correct access, conversion, geometry, JPEG 2000, packing, pasting, and unpacking behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
These image modes currently use 4 bytes for each pixel, but they only need two. I've started looking into this, but there are a lot more changes than I expected, so I'm creating this issue for documentation. The files I've found that need to be changed are:
- /src/libImaging/Access.c
ImagingAccessInit()contains a mapping to three functions (also defined in this file) for each of these modes.
- /src/libImaging/Bands.c
- Lots of special casing for "LXXA", and some functions assume an image with 2 bands uses 4 bytes per pixel.
- /src/libImaging/Convert.c
- All of the conversion functions for these modes.
- /src/libImaging/Geometry.c
bicubic_filter32LA()andbilinear_filter32LA().
- /src/libImaging/GetBBox.c
ImagingGetBBox()creates a bit mask for the alpha channel.
- /src/libImaging/Imaging.h
IMAGING_PIXEL_LAandIMAGING_PIXEL_PAare defined in this file, though they aren't used anywhere.
- /src/libImaging/Jpeg2KDecode.c
j2ku_graya_la()is currently used for both "LA" and "RGBA", so it will first have to be duplicated and renamed for "RGBA", and then the original can be modified.
- /src/libImaging/Jpeg2KEncode.c
j2k_pack_la().
- /src/libImaging/Pack.c
- The references to
packLA()can be replaced withcopy2(), andpackLAL()needs to be modified.packLA()is no longer used after this change, so it can be removed.
- The references to
- /src/libImaging/Paste.c
fill_mask_L()uses a mask for the alpha channel, andImagingPaste()calls the same function for "LA" and "RGBA".
- /src/libImaging/Storage.c
- The image pixel size and line size are set in
ImagingNewPrologueSubtype().
- The image pixel size and line size are set in
- /src/libImaging/Unpack.c
unpackLA()andunpackLAL().
- /src/PIL/PyAccess.py
- The
mode_mapuses_PyAccess32_2()for these modes.
- The
Changing im->pixelsize from 4 to 2 also means the image data will be stored in im->image8 instead of im->image32. im->image also exists and always holds the image data. The only difference between these pointers is their type: image is char, image8 is UINT8, and image32 is INT32. Some functions check for im->image8 being set and do different things based on that.
- Vorherrschende Sprache
- Python
- Sterne
- 14k
- Forks
- 2.6k
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 205
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python-pillow/Pillow
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
python-pillow/Pillow#10590 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Image.thumbnail() raises ZeroDivisionError when the target height is 0Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
python-pillow/Pillow#10589 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Sun raster files with RLE encoding and odd-width rows decode shiftedEvtl. vergeben @PerryLink hat das vor 21 Tagen übernommen. Offen🤖-assisted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
python-pillow/Pillow#10370 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Warn that pre-applying arabic_reshaper + python-bidi corrupts text on a Raqm buildEvtl. vergeben @Syamjith-NK hat das vor 85 Tagen übernommen. OffenDocumentation Font Rendering PNG Third Party Framework
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
python-pillow/Pillow#9907 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Example code in ImageText documentation makes incorrect use of get_bbox()Evtl. vergeben @mmporong hat das vor 1 Tag übernommen. OffenDocumentation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 25/100
python-pillow/Pillow#10583 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in python-pillow/Pillow
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
vllm-project/vllm#69304 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
interpreter-core type-bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
pydanty:is-working
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
pydantic/pydantic-ai#14187 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
test
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
prebid/salesagent#2676 ·
Maintainer antworten meist innerhalb von 1 Tag