Skip to content

Instantly share code, notes, and snippets.

from PIL import Image
im = Image.open('sample.gif').convert('RGB').save('convertfromgif.jpg')
<?php
$data = imagecreatefromgif('sample.gif');
imagejpeg($data, 'convertgifimage.jpg');
$ brew install sqlite expat
==> Installing sqlite dependency: readline
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/readline-6.3.8.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring readline-6.3.8.mavericks.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
Mac OS X provides similar software, and installing this software in
parallel can cause all kinds of trouble.
@@ -175,7 +175,7 @@ end
desc "Clean out caches: .pygments-cache, .gist-cache, .sass-cache"
task :clean do
- rm_rf [".pygments-cache/**", ".gist-cache/**", ".sass-cache/**", "source/stylesheets/screen.css"]
+ rm_rf [Dir.glob(".pygments-cache/**"), Dir.glob(".gist-cache/**"), Dir.glob(".sass-cache/**"), "source/stylesheets/screen.css"]
end
desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel] agree
You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf
clang: error: no input files
<?php
$size = getimagesize('http://free-photos-ls01.gatag.net/images/lgf01a201304271400.jpg');
var_export($size);
/* output
array (
0 => 1024,
1 => 768,
2 => 2,
3 => 'width="1024" height="768"',
@kamatari
kamatari / cmake_error
Created September 26, 2014 06:17
install failed log of opencv
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_core.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_warp_affine.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_resize.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_remap.cpp.o
[ 67%] Building CXX object modules/gpu/CMakeFiles/opencv_test_gpu.dir/test/test_hough.cpp.o
Linking CXX executable ../../bin/opencv_test_gpu
[ 67%] Built target opencv_test_gpu
[ 67%] Generating opencv_ocl_pch_dephelp.cxx
Scanning dependencies of target opencv_ocl_pch_dephelp
[ 67%] Building CXX object modules/ocl/CMakeFiles/opencv_ocl_pch_dephelp.dir/opencv_ocl_pch_dephelp.cxx.o
import cv2
# built-in module
import sys
if __name__ == '__main__':
print __doc__
try:
'''
usage:
python show_camera_or_video.py
or
python show_camera_or_video.py cam
or
python show_camera_or_video.py inputfilename.avi
'''
import numpy as np
<?php
$url = "http://31.media.tumblr.com/tumblr_mc4u6lwZHr1qf4k86o1_500.jpg";
$img_string = file_get_contents($url);
$img_data = imagecreatefromstring($img_string);
// make color
$gd = imagecreatetruecolor(1,1);
$red = imagecolorallocate($gd, 255, 0, 0);
// drawing