[SOLVED] sequence and merge jpeg images using pyhton?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Im doing a project as part of academic programme.Im doing this in linux platform.
Here i wanted to create a application which retreive some information from some pdf files .
For eg i have pdfs of subject2,subject1,in both the whole pdf is divided in to 4 modules and i want to get the data of module 1 from pdf.
For this purpose i have used PDFTOHTML application and converted pdf files to html and jpeg images.
Now i want to create a pyhton script which will combine the pages(which have been coverted in to jpeg images) under module 1 and merge it into a single file and then i will convert it back to pdf .
How can i do this?.If anyone can provide any such python script which have done any functions similar to this then it will be very helpful.
Please define "sequence" and "merge" more precisely. Do you want to number them (in their filename)? Put them together in an animation?
To get you started, maybe you can have a look at ImageMagick (http://www.imagemagick.org). Can work from commandline
and has a Python interface you can use. I use it regularly for animations, mosaics,...
ImageMagick's convert tool should be able to put the JPEG images into one PDF file.
But then again, as it's your tutor who asked this... it's homework and the forum should not help you any further...(read the forum rules)
I have number of jpeg images(which is produced using pdftohtml tool by converting a pdf file). Now i need to take some images based on some condition(which i have vaguely specified in original post) and group it in to a single file and convert that file back to pdf
Its not a homework given to me by my tutor. I just used word tutor in place of Advisor who advised me to convert pdf to jpeg images
Im a newbie in python and ,so first all dont know whether this could done using python.If i could get a similar script then i will be able to study and make my own script for this purpose.
I desparetly need help as the project is not moving forward
Again, read the posts - ImageMagick's convert command can do that easily. And answer the question - why does it *have* to be in Python?
Python could call the convert (as external command) or you could try to use ImageMagick's Python interface. Just google for some examples.
should do the trick. There are plenty of options to toy with too.
Edit: Perhaps it's easier to delete the undesired JPEGs or to single out the desired ones (copying to a separate folder).
That's just a way to break up the problem into smaller pieces.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.