Debian Convert Gifs From Jpgs
I created OGV videos with the gtk-recordmydesktop
screencasting program, trying to tackle this problem here with bruteforce over X. I can view the videos with VLC.
Now, the task is to find some ways to convert OGV videos into GIF animations so I can display them on SE. How can I do that?
Matthias BraunConvert GIF to JPG. Web developer and programmer tools. World's simplest GIF converter. Just select your GIF picture or drag & drop it below, press Convert to JPG button, and you get a JPG. Press button, get JPEG. No ads, nonsense or garbage. Works only in modern browsers.
4 Answers
take a look at this: https://askubuntu.com/questions/107726/how-to-create-animated-gif-images-of-a-screencast/107735#107735
..... After the Desktop Recorder has saved the recording into an OGV video, MPlayer will be used to capture JPEG screenshots, saving them into the 'output' directory.
On a terminal:
Use ImageMagick to convert the screenshots into an animated gifs.
you can optimize the screenshots this way:
Simple script with good quality
Script:
Code from: https://superuser.com/a/556031/295664
Without palette: (231 KB)
With palette:(573 KB)
protected by Community♦Nov 22 '18 at 6:49
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
I want to convert some files from jpeg to pdf. I am using following command.
But I have 100 images. How should I convert all of them to corresponding pdfs?
I tried
It doesn't work.
Gilles12 Answers
enzotibenzotibYou can use the mogrify
command for this. Normally, it modifies files in-place, but when converting formats, it writes a new file (just changing the extension to match the new format). Thus:
(Like enzotib's ./*.jpg
, the --
prevents any strange filenames from being interpreted as switches. Most commands recognize --
to mean 'stop looking for options at this point'.)
faster but unusual syntax:
Runs in parallel (using https://www.gnu.org/software/parallel/). I haven't noticed any multi-threading in convert
yet, which would limit the effective parallelization. If that is your concern, see in the comment below for a method to ensure no multi-threading occurs.
In all of the proposed solutions involving ImageMagick, the JPEG data gets fully decoded and re-encoded. This results in generation loss, as well as performance 'ten to hundred' times worse than img2pdf
.
Can be installed with pip img2pdf
provided you have dependencies (e.g. apt-get install python python-pil python-setuptools libjpeg-dev
or yum install python python-pillow python-setuptools
).
Here is a way that combines the best of the above suggestions into a simple, efficient, robust command line:
It works fine with filenames that begin with a -
or contain spaces. Note the use of -iname
which is the case-insensitive version of -name
so it will work on .JPG
just as well as .jpg
.
This uses find
to get the file list instead of shell globbing with the *.jpg
wildcard which can result in an 'Argument list too long' error on some systems. Though as @enzotib points in a comment, behavior of using globbing in a for loop is different than for a command's arguments.
Also, find
will handle subdirectories, whereas shell globbing will not unless you happen to have shell-specific features like the **/*jpg
recursive globbing syntax in zsh.
EDIT: I thought I would add another useful feature of find
that I thought of after reading a comment by @IlmariKaronen about re-running the command and only converting files that have changed since the first run.
On the first pass you can touch
a timestamp file after the convert is finished.
Then add -newer timestamp
to the find
expression to operate on the subset of files whose last-modified time is newer than the timestamp file. Continue updating the timestamp file after each run.
This is an easy way to avoid having to resort to a Makefile (unless you're already using one) and it is another good reason why it is worth using find
whenever possible... it has versatile expressiveness while remaining concise.
You can do this with convert
directly. This is to be found at the bottom of ImageMagicks Site about Command Line Processing.
I've used the following makefile for something similar:
Now I can just run make
and I get png files for every svg file that lies around.
Edit
As requested:
- wildcards generates a list of all svgs in origs/
- pathsubst takes this list and produces a list of png file names (different folder and extension. Example:
origs/foo.svg
becomesfoo.png
) - Rule 1:
all: $(PNG)
defines, that the target 'all' depends on all PNGs - Rule 2:
%.png: origs/%.svg
defines, thethe file $X.png depends on origs/$X.svg and can be generated by callingconvert ... $< $@
.$<
is the dependency and and$@
is the target name
- RUle 3: is just for cleaning up
A tiny script would do the trick.(tested with ksh88 on Solaris 10)
script.ksh
Then you can run find
to execute the script:
Note that both script.ksh
and the find
command I gave you, might have different syntaxes depeding on the OS and the shell you are using.
Linux Make Gif From Video
The MacOS utility SIPS
Under MacOS (Sierra), Apple's built-in command-line utility sips
provides comprehensive access to all of Apple's raster-image utilities; this turns out to include the conversion of jpg
to pdf
.
For example, from an existing low-resolution/small-size jpg
image 'cat.jpg'
(of size 8401 bytes), the following command-line creates 'cat.pdf'
, with no change in raster-resolution and minimal expansion of file size:
Conversion to Adobe's PSD
raster-image format A similar sips
idiom creates Adobe-compatible *.psd
files
Note however the 30-fold file-size expansion that is attendant to the use of the Adope psd
raster-format.
Book Production In doing large-scale book production, involving hundreds of images, that are supplied in multiple formats, for me a convenient command-line idiom has been use ImageMagick
utilities to create pure raster-image files in png
format (with all meta-data and color profiles stripped-out), then use sips
to restore a uniform set of color profiles and/or comments, and use sips
also to generate final output files (most commonly *.png
, *.psd
, or *.pdf
files).
Unfortunately convert
changes the image before so to have minimal loss of quality of the original jpg
you need to use img2pdf
, I use this commands:
1) This to make a pdf
file out of every jpg
image without loss of either resolution or quality:
2) This to concatenate the pdf
pages into one:
3) And last I add an OCRed text layer that doesn't change the quality of the scan in the pdfs so they can be searchable:
Eduard FlorinescuEduard FlorinescuConvert Image To Jpg Free
Linux Gif
I got solve with imagemagick for conversion and parallel to accelerate my conversion process:
Rui F RibeiroIf you use only image files than maybe you would like to use Comic Book Archive (.cbr, .cbz, .cbt, .cba, .cb7)
- If you use 7Z then rename the file extension (suffix) to .cb7
- If you use ACE then rename the file extension (suffix) to .cba
- If you use RAR then rename the file extension (suffix) to .cbr
- If you use TAR then rename the file extension (suffix) to .cbt
- If you use ZIP then rename the file extension (suffix) to .cbz
This is much more flexible than PDF.