Skip to content

Instantly share code, notes, and snippets.

View bartread's full-sized avatar

Bart Read bartread

View GitHub Profile
@bartread
bartread / usefulimagemagickcommands.sh
Created July 10, 2023 20:44
Useful ImageMagick commands
#!/bin/bash
# Note, if using Cygwin, ImageMagick is *not* installed by default and will need to
# be manually selected during the install.
# Using these turns out to be much less effort than firing up GIMP and, moreover,
# all of these operations are of course scriptable for batch processing of images.
# RESIZING AN IMAGE
# Note that if file extensions don't match, the image will be converted
function noop() { }
function identity(x) { return x; };
var config = {
delay: 200,
duration: 500,
easing: function gimmeSomeEase(thingummy) {
var aResult = ...;
// Maybe do some stuff here
return aResult;
},
tick: {
tick$$1: function () {
var delay = config.delay || 0,
duration = config.duration || 300,
easing = config.easing || identity,
tick$$1 = (config.tick ? config.tick.tick$$1 : noop) || noop,
css = config.css;
var { delay = 0, duration = 300, easing = identity, tick: tick$$1 = noop, css } = config;
'use strict';
(function () {
var RADIANS_IN_A_CIRCLE = 2 * Math.PI;
var ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
var lookup = [];
for (var index = 0; index < 360; ++index) {
lookup[index] = Math.tan(index * ONE_DEGREE);
'use strict';
(function () {
const RADIANS_IN_A_CIRCLE = 2 * Math.PI;
const ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
let lookup = [];
for (let index = 0; index < 360; ++index) {
lookup[index] = Math.tan(index * ONE_DEGREE);
'use strict';
(function () {
var RADIANS_IN_A_CIRCLE = 2 * Math.PI;
var ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
var lookup = [];
for (var index = 0; index < 360; ++index) {
lookup[index] = Math.cos(index * ONE_DEGREE);
'use strict';
(function () {
const RADIANS_IN_A_CIRCLE = 2 * Math.PI;
const ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
let lookup = [];
for (let index = 0; index < 360; ++index) {
lookup[index] = Math.cos(index * ONE_DEGREE);
'use strict';
(function () {
var RADIANS_IN_A_CIRCLE = 2 * Math.PI;
var ONE_DEGREE = RADIANS_IN_A_CIRCLE / 360;
var lookup = [];
for (var index = 0; index < 360; ++index) {
lookup[index] = Math.sin(index * ONE_DEGREE);