snipt

Ctrl+h for KB shortcuts

Bash

Use Imagemagick to convert EPS to PNG

1
2
3
for f in `ls *.eps`; do
    convert -density 100 $f -flatten ${f%.*}.png;
done
https://snipt.net/embed/fc9757923e8ee51be0343f4cff04a292/
https://snipt.net/raw/fc9757923e8ee51be0343f4cff04a292/
fc9757923e8ee51be0343f4cff04a292
bash
Bash
3
2016-09-27T13:32:24
True
False
False
Jul 07, 2014 at 11:47 AM
/api/public/snipt/135711/
use-imagemagick-to-convert-eps-to-png-87cbddba
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">for</span> f in <span class="sb">`</span>ls *.eps<span class="sb">`</span><span class="p">;</span> <span class="k">do</span> </span><span id="L-2"><a name="L-2"></a> convert -density <span class="m">100</span> <span class="nv">$f</span> -flatten <span class="si">${</span><span class="nv">f</span><span class="p">%.*</span><span class="si">}</span>.png<span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="k">done</span> </span></pre></div> </td></tr></table>
eps, imagemagick, png

Bash

Convert eps images to png with bash and ImageMagick

1
2
3
for f in `ls *.eps`; do
	convert -density 100 $f -flatten ${f%.*}.png;
done 
https://snipt.net/embed/11826a99ba62636d8fccc3d60024ce58/
https://snipt.net/raw/11826a99ba62636d8fccc3d60024ce58/
11826a99ba62636d8fccc3d60024ce58
bash
Bash
5
2016-09-27T08:28:26
True
False
False
Nov 20, 2012 at 12:05 PM
/api/public/snipt/50514/
convert-eps-images-to-png-with-bash-and-imagemagick
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">for</span> f in <span class="sb">`</span>ls *.eps<span class="sb">`</span><span class="p">;</span> <span class="k">do</span> </span><span id="L-2"><a name="L-2"></a> convert -density <span class="m">100</span> <span class="nv">$f</span> -flatten <span class="si">${</span><span class="nv">f</span><span class="p">%.*</span><span class="si">}</span>.png<span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="k">done</span> </span></pre></div> </td></tr></table>
"convert eps to png", bash, convert, eps, eps2png, png

HTML

PNG IN IE6

1
2
3
4
5
6
7
8
<script type="text/javascript" src="./Scripts/DD_belatedPNG_0.0.8a-min.js"></script><!-- PNG IN IE6 -->

.js檔要更改的地方:

DD_belatedPNG.fix('.png,img');
 /* .png是所有应用了透明PNG的CSS选择器,你可以用你自己的选择器,比如 DD_belatedPNG.fix('.box a:hover');
 对于:focus和:hover伪类,可以用DD_belatedPNG.fix('.png, a.png:hover, .png:focus');
 */
https://snipt.net/embed/79fbb20ea83ec400085dd9e1549ebc20/
https://snipt.net/raw/79fbb20ea83ec400085dd9e1549ebc20/
79fbb20ea83ec400085dd9e1549ebc20
html
HTML
8
2016-09-24T09:38:46
True
False
False
/api/public/snipt/50442/
png-in-ie6
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nt">&lt;script </span><span class="na">type=</span><span class="s">&quot;text/javascript&quot;</span> <span class="na">src=</span><span class="s">&quot;./Scripts/DD_belatedPNG_0.0.8a-min.js&quot;</span><span class="nt">&gt;&lt;/script&gt;</span><span class="c">&lt;!-- PNG IN IE6 --&gt;</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>.js檔要更改的地方: </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>DD_belatedPNG.fix(&#39;.png,img&#39;); </span><span id="L-6"><a name="L-6"></a> /* .png是所有应用了透明PNG的CSS选择器,你可以用你自己的选择器,比如 DD_belatedPNG.fix(&#39;.box a:hover&#39;); </span><span id="L-7"><a name="L-7"></a> 对于:focus和:hover伪类,可以用DD_belatedPNG.fix(&#39;.png, a.png:hover, .png:focus&#39;); </span><span id="L-8"><a name="L-8"></a> */ </span></pre></div> </td></tr></table>
png

Text only

Convert graphviz .dot files to png

dot -Tpng filename.dot -o outfile.png
https://snipt.net/embed/40214316fb9ec7d51713ceed8709ca38/
https://snipt.net/raw/40214316fb9ec7d51713ceed8709ca38/
40214316fb9ec7d51713ceed8709ca38
text
Text only
1
2016-09-26T10:43:31
True
False
False
/api/public/snipt/36858/
convert-graphviz-dot-files-to-png
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>dot -Tpng filename.dot -o outfile.png </span></pre></div> </td></tr></table>
graphics, graphviz, png

CSS

Opacity Fix for IE7 & IE8

1
2
3
4
5
6
7
#element {
    background: url("alpha-transparent.png") no-repeat 0 0;
    filter: alpha(opacity = 80);
    filter: progid:DXImageTransform.Microsoft.gradient(
        startColorstr=#00FFFFFF, endColorstr=#00FFFFFF
    );
}
https://snipt.net/embed/14a177d2919382c82ac165b66ae6b599/
https://snipt.net/raw/14a177d2919382c82ac165b66ae6b599/
14a177d2919382c82ac165b66ae6b599
css
CSS
7
2016-09-27T03:40:09
True
False
False
/api/public/snipt/36513/
opacity-fix-for-ie7-ie8
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nf">#element</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">background</span><span class="o">:</span> <span class="sx">url(&quot;alpha-transparent.png&quot;)</span> <span class="k">no-repeat</span> <span class="m">0</span> <span class="m">0</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="n">filter</span><span class="o">:</span> <span class="n">alpha</span><span class="p">(</span><span class="k">opacity</span> <span class="o">=</span> <span class="m">80</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">filter</span><span class="o">:</span> <span class="n">progid</span><span class="o">:</span><span class="n">DXImageTransform</span><span class="o">.</span><span class="n">Microsoft</span><span class="o">.</span><span class="n">gradient</span><span class="p">(</span> </span><span id="L-5"><a name="L-5"></a> <span class="n">startColorstr</span><span class="o">=</span><span class="m">#00FFFF</span><span class="n">FF</span><span class="o">,</span> <span class="n">endColorstr</span><span class="o">=</span><span class="m">#00FFFF</span><span class="n">FF</span> </span><span id="L-6"><a name="L-6"></a> <span class="p">);</span> </span><span id="L-7"><a name="L-7"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
background, css, png, transparency

Bash

Convert png frames into an mpeg4 movie

# -qscale <quality>[1, 31], -r <frame-rate> -b <bit-rate>
ffmpeg -qscale 1 -r 2 -b 9600 -i %03d.png movie.mp4
https://snipt.net/embed/4fb89a7398caef2c7bd9113fe8ce60e9/
https://snipt.net/raw/4fb89a7398caef2c7bd9113fe8ce60e9/
4fb89a7398caef2c7bd9113fe8ce60e9
bash
Bash
2
2016-09-22T00:20:09
True
False
False
/api/public/snipt/28023/
convert-png-frames-into-an-mpeg4-movie
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># -qscale &lt;quality&gt;[1, 31], -r &lt;frame-rate&gt; -b &lt;bit-rate&gt;</span> </span><span id="L-2"><a name="L-2"></a>ffmpeg -qscale <span class="m">1</span> -r <span class="m">2</span> -b <span class="m">9600</span> -i %03d.png movie.mp4 </span></pre></div> </td></tr></table>
ffmpeg, movie, mp4, png
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.