MolotovCherry / kmagick

Kotlin ImageMagick bindings to the MagickWand API
MIT License
40 stars 4 forks source link

Convert image api #13

Closed SchweinchenFuntik closed 1 year ago

SchweinchenFuntik commented 1 year ago

JPEG convert to BMP. looking for a good image format envelope library

MolotovCherry commented 1 year ago

looking for a good image format envelope library

Not sure what you mean here. What are you looking for exactly?

But in either case, this project is only bindings to the underlying imagemagick lib, whichever one is used (whether windows dll or android so, or whatever). The underlying lib is the one that is able to open different image types as well as convert them. So these bindings have no ability to change whether it can or can't open or convert different image types.

If you want to "convert", you can just open the image and re-save it.

SchweinchenFuntik commented 1 year ago

Now imagemagick is used for converting, but in the form of a script. I want to replace this with a call from the code

Current command Windows magick mogrify -path path -format bmp *png

MolotovCherry commented 1 year ago

Now imagemagick is used for converting, but in the form of a script. I want to replace this with a call from the code

Current command Windows magick mogrify -path path -format bmp *png

You should be able to simply open the image and save it. This will convert it. Please see the example for more

    // close resources when finished
    Magick.initialize().use {
        val wand = MagickWand()

        wand.readImage("blah.jpeg")

        // write result out
        wand.writeImage("D:/out.png")
    }