Sips is a lifesaver!

I just recently found out that macOS comes with a terminal-based batch processing application called sips, the scriptable image processing system.

One thing I found out I can do is write:

for i in *.NEF; do sips -s format jpeg $i --out "${i%.*}.jpg"; done

And convert all files in a directory from Nikon Raw files to jpeg.

Another useful option is

sips -Z 1000 *.jpg

This changes the size of all the images in a directory so that the longest size is 1000px at maximum, note that this will overwrite the files with the new resized files, so be sure to work on a copy of the directory and not the original.

What week is this?

Today I was a bit impulsive and registered the domain name weeknum.org.

Then I made a little php-application showing the day of the week, with the background color calculated using the week number, month and day to create a hex code.

I might even try out some AJAX and jQuery on this page and see if I can make it a little more stylish and interactive.

If you want to check start and end dates of another week number, just add the suffix /[week number] to the URL.

For example, if you want to find information about week number 42, then go to weeknum.org/42.

Getting started with QuarkXPress

For far too long I’ve been doing layout work in Illustrator and Affinity Designer.

It’s not that it’s bad to do so, vector graphics applications have all the tools to create a single page poster, business card or some other things for print, but lately I’ve found I do work that spans over multiple pages where I need a consistent design – what I need are stylesheets and master pages.

So now that I do most of my design work on my mac and my Adobe CS5 package for Windows is getting a bit dated anyway I thought I’d learn the other “industry standard” application for desktop publishing: QuarkXPress.

Compared to other professional grade software and the fact that they have a few good offers I’m really pleased with getting a full fledged DTP-program. I tried the Open Source Scribus first, but it couldn’t do something so basic as to have master page elements in front of the background.

Now I’m using it to design menu items for websites and will probably use it for my résumé.

 

Logo, Website, WordPress and Menu Items

Designing logos and setting up websites is starting to get a routine.

Today I was asked by my boss to set up the website www.bellonordic.no, he had a few logo design suggestions and a general idea of the website layout.

It seems one of my earlier designs caught on since his new design suggestion hinted toward having three “mountains” in the background, so all I had to do was slightly alter my design, create a few alternative logos and I was done.

 

Then I had to set up the WordPress site. So I picked a theme, dug up some stock photos for menu items and used the art-boards to keep a consistent design.

I really wish Serif would release their upcoming desktop publishing tool “Affinity Publisher”, as much as I like Affinity Designer, I’d prefer to use more proper layout tools when doing layout work.

Stock Images

I’ve done some restructuring of the page lately.

The About Me page has been divided into separate pages for clarity, the following pages are:

Work History : A table containing information about where I’ve worked over the years.

Occupation : A description of where and what I’m currently working with.

Competencies : A list of software, technologies, programming languages and vocational subjects I’m familiar with.

Education : Information about my formal education, including a list of courses.

I’ve also added a few pages to my Photography section, especially the Stock page containing images made to be used as stock images for designs and illustration purposes.

Column Switcher

Yesterday I met a problem where I needed to replace the columns of a csv-file separated by whitespace, since this was some pretty basic stuff I wrote a simple program in Java fairly easily.

Today when I woke up I thought that maybe I should try and see how I could do the same with Shell Scripting, so here goes (the programs are available at my github here):

import java.util.Scanner;
import java.io.*;

public class Cols {

    /**
     * This program takes a csv file separated by whitespace and replaces the first with the second column.
     * @name Cols
     * @author tcarisland
     * @date 6.sep.2017
     */

    public static void main(String args[]) {
	try {
	    Scanner in = new Scanner(new File(args[0]));
	    PrintWriter out = new PrintWriter(new File(args[1]));
	    while(in.hasNextLine()) {
		String cols[] = in.nextLine().split("\\s+");
		if(cols.length > 1)
		    out.println(cols[1] + " " + cols[0]);
	    }
	    in.close();
	    out.close();
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }

}

 

And the Bash program:

 

#/bin/bash

#A minimal version of the cols program to do exactly the same as the java program.
#Needs two arguments.

rm -f $2 && touch $2;

while IFS=" " read c1 c2
do
    echo $c2" "$c1 >>$2;
done < $1

HashMapMaker

While working on a problem today I found I wanted to simplify the process of creating predefined HashMaps.

So I made this little utility program to take two files and create a HashMap<String, String> from such a file.

Nothing much, but I put it up on my GitHub here nonetheless.

import java.util.Scanner;
import java.io.*;

public class HashMapMaker {

    /**
     * A simple program that creates a HashMap from a file with fields separated by whitespace.
     * @name HashMapMaker
     * @author tcarisland
     * @date 5.sep.2017
     */
    
    public static void main(String args[]) {
	try {
	    Scanner in = new Scanner(new File(args[0]));
	    PrintWriter out = new PrintWriter(new File(args[1]));
	    out.println("private static final Map<String, String> m = new HashMap<String, String>() {{");
	    while(in.hasNextLine()) {
		String pair[] = in.nextLine().split("\\s+");
		if(pair.length > 1)
		    out.println("put (\"" + pair[0] + "\", \"" + pair[1] + "\");");
	    }
	    in.close();
	    out.println("}};");
	    out.close();
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }
    
}

KML Contracting

A few years ago, back in 2015, I was contacted due to a texture I made earlier.

Apparently, the “diamond plate” pattern I made just for the fun of it proved to be a useful resource for multiple graphic designers and illustrators and Tina (as her name was) wanted to use it for a contracting company based in Pennsylvania called KML Contracting.

Since I wasn’t selling the texture at a stock website or anything I agreed for her to use the image as she liked free of charge as long as I was mentioned and got bragging rights as a designer.

So here it is, logo and everything (that is, I made the texture, Tina Andrews designed the logo):

More modular

I started working on another modular font the other day, and found out I could do all sorts of neat variations on this design, so now I have four different drafts and I still haven’t moved on to importing shapes into FontForge.

Part of the reason why is that I planned on doing the “expand stroke” operation in Illustrator or Inkscape since Affinity Designer tends to make overly complex shapes with too many nodes when expanding circular or curved shapes.

I’m hoping to finish this project some time during the next few days, but in the meanwhile – here’s how it looks now.