Skip to content

Support cropping transparent images #37

Closed
@TimMun

Description

@TimMun

Feature Request

Support cropping transparent images. Currently, if you crop a partially transparent image, all the transparent pixels become white.

Why it is needed

I'm upgrading my app from RN 0.59 to 0.61. The old ImageEditor bundled with RN 0.59 supported cropping transparent images.

Possible implementation

Use UIImagePNGRepresentation instead of UIImageJPEGRepresentation? Not sure about Android

Code sample

// localFilePath contains a PNG with partially transparent image. Maybe cropData can take an extra flag to use png

let cropped = await ImageEditor.cropImage(localFilePath, {usePNG: true} )

// cropped should contain a uri with the transparency preserved

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions