23.08.2019»»пятница

Debian Convert Gifs From Jpgs

23.08.2019
    96 - Comments
  1. Linux Make Gif From Video
  2. Convert Image To Jpg Free
  3. Linux Gif

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 Braun
2,4082 gold badges16 silver badges27 bronze badges

Convert 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.

user2362

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:

Community
maniat1kmaniat1k
8763 gold badges20 silver badges34 bronze badges

Simple script with good quality

Script:

Code from: https://superuser.com/a/556031/295664

Without palette: (231 KB)

With palette:(573 KB)

Community
Dawid DrozdDawid Drozd
luatorluator
Peter.OPeter.O
19.7k18 gold badges95 silver badges148 bronze badges

protected by CommunityNov 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

Debian Convert Gifs From Jpgs

It doesn't work.

Gilles
562k134 gold badges1158 silver badges1666 bronze badges
Pratik DeogharePratik Deoghare
6021 gold badge7 silver badges15 bronze badges

12 Answers

enzotibenzotib
35.6k10 gold badges105 silver badges97 bronze badges

You 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'.)

rubo77
8,37627 gold badges76 silver badges142 bronze badges
cjmcjm
21.2k6 gold badges72 silver badges74 bronze badges

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.

SebastianSebastian
5,5964 gold badges31 silver badges47 bronze badges

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).

Robert FlemingRobert Fleming

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.

Community
aculichaculich

You can do this with convert directly. This is to be found at the bottom of ImageMagicks Site about Command Line Processing.

Frank ZalkowFrank Zalkow

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 becomes foo.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 calling convert ... $< $@.
    • $< is the dependency and and
    • $@ is the target name
  • RUle 3: is just for cleaning up
retoreto

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.

rahmurahmu
10.7k20 gold badges70 silver badges114 bronze badges

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).

John SidlesJohn Sidles

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 pdfpages 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 Florinescu

Convert Image To Jpg Free

3,74610 gold badges39 silver badges57 bronze badges

Linux Gif

I got solve with imagemagick for conversion and parallel to accelerate my conversion process:

Rui F Ribeiro
40.8k16 gold badges91 silver badges152 bronze badges
Giovanny CanastoGiovanny Canasto

If 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.

jojojojo

Not the answer you're looking for? Browse other questions tagged command-linewildcardsconversionimagemagick or ask your own question.