Not able to read PNG format Image using Jmagick library - png

I am able to read JPEG format image and can write JPEG format image. I want to do same for PNG format image but i am not getting how to do that.

It's the same concept as jpeg. One of the "magicks" of the library is that it is largely type independent when writing the code. Try doing it the same way.
If you're attempting to do conversion, maybe try looking here.

Related

How to convert a List<Uint8list> to GIF?

How to convert List<Uint8List> to an animated GIF?
my List<Uint8List> consists of images and I need to merge them and make them as GIF.
I've tried this but it does not animate:
Is their any way to convert .jpeg images to .gif in flutter?
The link you provided should work. If not, please give a reproducible sample. For example, provide your sample List<Uint8List>. In addition, what error messages do you see?
Without further information, I guess your Uint8List is not of the correct format. If you upload one example Uint8List (you know, just some bytes), I can have a look.
By the way, I suggest to have some basic understanding of image formats. For example, what is a "bitmap" (pixels are arranged byte by byte), and what is a encoded format like jpeg/png/gif/etc.
I think the best thing is that you develop the gif in any program for this and then load it with your app from the assets, if you need help tell me and I can help you better by sending me the images to make the gif

Thumbnailator conversion from PNG to JPG results in all-white image

For many images, this code works fine to convert a PNG image to JPG:
Thumbnails.of(pngIn)
.outputFormat("jpg")
.scale(1.0)
.toFile(jpgOut);
But for this specific image:
the code results in an all-white JPG image. If someone can point me to the right way of doing things in Thumbnailator, I would very much appreciate it. Cheers!
EDIT: Well, something in the image upload / download process makes things work for the attached image! (The downloaded image is 50K while the original image is 41K, so clearly there's some funkiness going on there.) But I promise that the original PNG really does not work.
EDIT 2: This link to Google images can be used to download the 920x900 PNGWing image (41K) on the right side of the page.
The above syntax seems to be correct for converting PNG to JPG. The problem is that when the referenced image is read into a BufferedImage object, the image's type is BufferedImage.TYPE_BYTE_BINARY. While such images can be 1, 2, or 4-bit images, Thumbnailator doesn't handle 2- or 4-bit images correctly, essentially assuming that the image is a 1-bit image.
In short: the syntax is correct, but there appears to be a Thumbnailator bug that hinders successful processing of some PNG files.

AlamofireImage: Is it possible to get the raw data from an NSimageview in Swift?

I am using an imagewell to accept jpg images being pasted or dragged into my OSX app. The problme is that I am struggling to get the original jpg images as OSX seems to requires me to get the Tiff version of the NSImage if I want to uplod via Alamo Fire.
Does AlamoFireImage have a fancy way of getting the original url / original raw data without converting to Tiff first?
Actually, with an NSImageWell, you don't have much possibilities regarding the dropped image. It's a convenient class for showing dropped images but as soon as you need to do more, it's not up to the task.
I suggest you use an NSImageView instead, and add drag and drop capabilities to it like in my example here: https://stackoverflow.com/a/29233824/2227743
This way you can easily get the dropped image's URL (and filename), and the image data itself of course.

Does PNG support metadata fields like Author, Camera Model, etc?

When I click on the image>property>details of a PNG image in Windows many fields are missing compared to a JPEG file. Are these fields supported in PNG? If so, how would they be added in a PNG file programmatically?
section 11.3.4.2 of the PNG spec gives a list of pre-defined meta tags (keywords)
http://www.w3.org/TR/PNG/#11textinfo
you can add as many other meta tags/fields as you would like.
as for how, programmatically, that depends on the language you're using!
PNG has no EXIF chunk. Thus EXIF metadata will get lost if you convert from JPEG into PNG.
However Adobe has made XMP for storing all kinds of metadata. So that you can convert between JPEG and PNG while preserving metadata.

how to get the image position from pdf file in objective c?

I am doing something like extracting the pdf text in a string format so as to annotate the text and in the same process i need to find the image positions covered in the same pdf file so as to maintain its position. Now the problem is that i am not getting the exact positions of the images in the same pdf file. Is it possible to use some thing like OCR,if yes,how to use that?
Can anybody help me in finding the exact position of the image in the pdf file? I need to implement some pdf reader kind of application for ipad,that's just for the knowledge.
Thank you.
Isn't OCR a little bit heavy weight for iphone?
Take look on tools like pdftotext from Xpdf. It is much simpler to read data, as to render and recognize it back again.