.HEIC file to .JPG not identified by PIL.Image - python-imaging-library

I am running a script to extract the EXIF data from a list of images in a folder that are imported from an iPhone using Python's pillow:
from PIL import Image
image = Image.open(path)
But before anything, some of the pictures need to be converted from iOS' format .HEIC to .jpg. I successfully managed to do so but when I try to open the image that was converted I get the following:
PIL.UnidentifiedImageError: cannot identify image file '.../pictures/IMG_4294.jpg'
See this image comparing the info of two files. The one on the left was converted from .HEIC to .jpg and doesn't work. The one on the right is originally a .jpg and works just fine.
Any thoughts on how I can solve this?

Related

How to extract texts from images in a folder

My laptop is Ubuntu, I have a folder called testdata which contains lots of jpg images, I want to know how to run Tesseract on all these images and save outputs to another folder e.g. "testresult". Outputs can be a single txt file contains extract texts from all images. Or, it can be one txt file for one image extracted text only.
For a single image, the command line I know is tesseract test_01.jpg test_01
Could anyone help me please?

Export NetLogo output in .tiff or .jpg

I have a 300x300 world and I would like to save the generated result in .jpg or tiff format. Could someone tell me if it is possible to do this? I have so far only been able to export in .txt or .csv. Sorry for the beginner's question. If anyone can provide me with some direction, I would appreciate it.
You can use export-view view.png or export-interface interface.png in the code. Afterwards you can convert the .png to .jpg, if that's neccesairy.
If you want to do it manually, you can right click on the view and choose "Export View..." or in the upper left "File" -> "Export" -> "Export View ..."
See post von user Lena.
In the command-center-console (near observer>) you can type user-directory to find the output-directory where Netlogo will save the file to,
and then, again in the command-center-console, type
export-view "myworld-view.png"
Attempting to save as JPEG with myworld-view.jpg, or to save as TIFF with myworld-view.tiff, do not seem to work. These do not throw an error, but the images saved are still PNG files. (at least on my machine).

Is there any way to convert lammp_file.data to Gromacs files (top and gro), if not then to or to CHARMM files (psf and pdb)?

I have a lammps_file.data and I need to convert it to Gromacs files (gro and top) to run my simulations.
Does anyone know how to do this?
Another choice is to convert from lammps to charmm files (psf and pdb). Once I get the charmm files I can just use Topotools to get the gromacs files I need.
Thanks
Indeed, NOW I am trying to do the same myself.
So far, you can use intermol , this should work fine to convert LAMMPS data files to Gromacs files. Once you install intermol, and you ceate a path to the intermol converter, you can use a command like:
python2.7 $conv/convert.py --lmp_in topology.data --gromacs -v
CHECK the format of your data file, I still having problemst to convert it.
If you wish to create the psf file,
you would need VMD (google it), then open the tcl terminal and write :
topo readlammpsdata topology.data full
animate write psf topology.psf
The 1st line is for loading yur LAMMPS data file, if you are in the folder where
that files is located
2nd convert the data to psf CHARMM
Also, you could try this. In this paper, they provide a tood to conver
CHARMM topologies to gromacs here. Thus, you convert to psf, then to gro top.

How to convert .SFF file format to .BMP or .PNG or .JPG?

I need to convert my SFF file to PDF, then i need verify the document. i.e SFF file and converted file.
For that, I think to convert SFF file to image file and PDF file to image file.
Then comparing the both file using image processing.
To do this method:
Im searching for a program to convert SFF to BMP
Does anyone know such a program or has another idea how to do the job?
Thank you in advance...
Looks like you need reaConvertor. It appears to be a matured tool you can rely on. There is an online version of the tool here
I think:
https://github.com/Sonderstorch/sfftools
will do what you need (convert sff -> tiff/jpeg/..) and then you can use imageMagic (for example) to go to PDF.
Clearly not a current well used image format, however if you have legacy.sff Structured Fax Format, they are similar (not exactly identical) to a Monochrome G4 format.
By far the simplest programmable method to convert is using IrfanView which can Read Modify and Resave as other formats in batches.
Out put can be any other modern image type including Mono.BMP, G4.fax or as PDF (with or without GhostScript)

pkl file for customized image data in pylearn2

I'm totally novice in pylearn2 & right now I'm working in Brats database in which we work on 3D MRI of brain for tumor segmentation by using Pylearn2 same as explained in pylearn2 tutorial for CIFAR10 Database .
My problem is that all the volumetric images in database is in .mha format and in order to use Pylearn2-CNN I must have either .pkl file or the binary files for the image database. "Image" module can't read .mha file.
Can anybody tell me how to work with .mha files in Pylearn2 and how to generate .pkl file for .mha files.
You could try converting your files from .mha to png and then making a .pkl file.