07 Jul

Let us make you more efficient!

cogs

If you don’t see the Ghostotter product you need, why not hire us to make it for you? We’re available for small to medium sized custom development on Mac OS X.

We specialise in building software to save time and simplify things in the graphic design and packaging industries. Whether it’s a Mac OS X application, custom AppleScript or shell script then we can help.

Past projects include:

  • Custom OS X apps and utilities
  • Custom Automator actions
  • Custom shell scripts for image processing
  • AppleScripts to gather linked images from Illustrator files
  • Merging XML files with Illustrator/InDesign templates to create artworks
  • AppleScripting the Adobe CS suite (Illustrator, InDesign, Photoshop, Acrobat)

    If you could use our help, contact us via our support page: https://www.ghostotter.com/support/

  • 07 Jul

    Do you know your BWR?

    We’ve recently had a couple of users of Barcode Basics (our mac barcode software) ask us what BWR is.

    BWR stands for Bar Width Reduction. This allows you to reduce the width of each individual bar in your barcode by a certain amount. A common mistake is to specify a BWR as a minus number which in fact leads to an increase in bar width.

    Of course, there are some rare occasions where you might need to increase bar width. However, remember that to reduce bar width, you need to have a positive BWR value.

    Why do we use BWR?

    The width of the bars in a bar code is important and needs to be precise to ensure they will scan properly. Depending on how you’re printing you bar code, you might find that the width of the bars increases when you print them. Think of how the ink spreads when you draw on tissue paper with a marker pen. This could result in the barcode not scanning properly.

    This ink spread is especially common in commercial printing using a traditional printing press, rather than the type of printer you probably have on your desktop. So, to make sure the printed bars are the right width, we reduce the width of the bars in our code by using the appropriate BWR value.

    How do I know what BWR value to use?

    For most types of digital printing, including desktop laser printers you almost certainly don’t need any BWR, so just set it to zero. If you can, make a code, print it and scan it to make sure it works (there are several good barcode scanners for iOS and Android phones). If the barcode scans then your BWR is fine. If not then you may need to experiment.

    If your code is going to be printed commercially on a printing press of some description then its a good idea to speak to the printing company and ask what BWR setting you should use. If they don’t know then alarm bells should ring – a reputable printer really should know that!

    Scanning your code

    There are several barcode scanning apps for iOS and Android on their respective app stores. You could also use a hand held scanner such as this one (click the image for more info):

    scanner

    …none of them will check your BWR, of course, but if you can successfully scan your printed code then your BWR was correct.

    While we have your attention, why not check out our flagship barcode app on the Mac App Store?

    Barcode Basics on the Mac App Store

    05 Jul

    Automated image processing on Mac OS X

    cogs

    If you’ve ever had to convert a few hundred images from tiff to png, create thumbnails of them you’ll know how time consuming and boring it can be. It can also be surprisingly error prone as your mind drifts off halfway through to think about what you’re up to at the weekend. Computers were supposed to relieve us of this kind of drudgery, right?

    Luckily, every Mac has a powerful system lurking under the hood called ‘sips’ (Scriptable Image Processing System). You can use it to do all sorts of interesting things to raster images (eg. jpeg, tiffs, png etc) without ever having to fire up Photoshop. In this article I’m going to show you some simple uses of sips, and how to roll them up into a handy Automator workflow.

    A quick into to sips
    First, lets fire up the Terminal. It’s just an app that lets us work on the command line and you’ll find it in /Applications/Utilities. Type the following at the prompt:

    sips -s format png

    …next, drag any image file other than a png file into the Terminal. You should now have something in your Terminal that looks like this:

    sips -s format png /path/to/your/file.jpg

    That tells sips that we want to change the format of the image we dropped to a png. All we need to do now is to tell it where to put the resulting file. We can do this by adding –out followed by the location of the file we want to be created, so add that into your Terminal like this:

    sips -s format png /path/to/your/file.jpg --out /path/to/your/file.png

    Note that for the output file path, I just copied and pasted the input file path and changed the extension to “png”. Alternatively, I could have used something like “~/Desktop/file.png” to save the file to my desktop, or I could have used any other path that suits my purpose. Now we have a full sips command, so hit return to execute the command and a file should be created at the location you specified with the –out parameter.

    The sips command we just created is a fairly typical one. Note that the word ‘sips’ is followed by some parameters (in our case, “-s format png”), then the path to the source file, then we used –out to tell sips where to put the resulting file. One thing to remember is that having your input file path the same as the output file path is generally a Bad Thing.

    There are many other things you can do with sips, including resizing images, changing resolution, applying ICC profiles and so on. The manual (aka man page) is available by typing “man sips” in the Terminal or, if you prefer, click here to view it online.

    Using SIPS from Automator
    There’s nothing wrong with using SIPS as shown above, but the Terminal isn’t particularly user friendly. It’d be better if we could just select a load of files in the Finder and process them, right? That’s what we’ll look at now. First, launch Automator (you’ll find it in your Applications folder). Create a new workflow, being sure to select “Service” as shown below.

    screen 1

    Next, set the “Service receives selected” popup menu to “image files” and select “Finder.app”. This means that our workflow will be available when we select images in the Finder.

    screen 2
    Next, type “shell script” into the search field and drag the “Run Shell Script” action into the area under the popups we just set. Change the “Pass input” drop down to “as arguments”. You workflow should now look like this:

    Next, replace the default text “cat” with the following:

    for theFilePath in "$@"; do

    done

    In case you’re not familiar with shell scripting, this is a simple loop. When we execute the Run Shell Script action, it will be passed a list of files called “$@”. What we’ve written is a script to loop through this list. The loop starts at “do” and ends at “done”. Every time the loop repeats, the variable “theFilePath” will be the next file name in the list. Your workflow should now look like this:

    screen 4
    At the moment, our script doesn’t do anything because there is nothing between “do” and “done”. We need to add some sips magic! In between “do” and “done” add the following:

    sips -s format png "$theFilePath" --out "${theFilePath%%.*}.png"

    Note that I’m using the theFilePath variable as the input. The confusing stuff as the output just knocks the file extension off the theFilePath variable and adds “.png”. Your workflow should now look like this:

    screen 5
    Next, save your workflow and give it a name. I chose “Convert Images”.

    Okay! Now for the fun bit. Find one or more images (not a PNGs!) in your Finder. Click the file whilst holding “ctrl” down and scroll down to Services, then select your workflow.

    services

    Your selected files will be converted magically into PNG files! NB. If nothing happens then check you selected “Pass input: as arguments” in the Run Shell Script action.

    If I want to create multiple images, then it’s fine to add extra sips commands. So if I want to create a thumbnail image then I can change my shell script to:

    for theFilePath in "$@"; do
    sips -s format png "$theFilePath" --out "${theFilePath%%.*}.png"
    sips -s format png -Z 100 "$theFilePath" --out "${theFilePath%%.*}_thumbnail.png"
    done

    …see the sips man page to see how the -Z option works!

    Hope that gives some you ideas and saves you some time!

    02 Jul

    Five barcode myths debunked

    This barcode is not Satanic. Honest.

    Barcodes reveal a product’s country of origin

    EAN13 barcodes used on European products encode a number which begins with a sequence of digits that refer to a country. However, this refers to the country of the organisation which allocated the number. This isn’t necessarily the same as the country of origin.

    For example, if a French company import oranges from Spain, puts them in boxes and sells those boxes of oranges then the barcode number would probably start with the French country code. Yes, despite the oranges being Spanish. So if you want to know where a product comes from, read the label, not the barcode!

    The first digit of a barcode tells you if the product is organic or not

    Not true. As discussed above, the initial digits of a barcode tell you the country of the organisation that allocated the barcode number. This is usually the same as the country of the organisation selling the product. PLU codes used in the USA can include this information, but they’re nothing to do with the barcode.

    The font used for the numbers is important

    Well, okay, sort of. Generally speaking the numbers in a barcode use the font OCR-B or Helvetica (Barcode Basics uses Helvetica). However, barcode scanners scan the bars of the code, not the human-readable numbers so in that respect, the font used doesn’t matter. However, if the barcode fails to scan for any reason then someone may end up having to key in the code manually (e.g. a checkout assistant). For that reason, it’s important to make sure that whatever font you use, it’s easily readable.

    It’s difficult and expensive to generate a barcode

    No it’s not. You can buy software very cheaply, often for under $10 (e.g. budget Mac OS X barcode generator Barcode Basics) that will do the job. You do, however, need to check a few things.
    1. Find out whether you can make up your own barcode number or whether you need to get an organisation to allocate you one.
    2. Find out what type of barcode you need e.g. EAN13, UPCA, ITF14 etc
    3. If your barcode will be printed by a commercial printer, ask them for their recommended barcode specifications e.g. bar width reduction (bwr), magnification etc.

    You can get professional quality barcode applications for Mac OS X for under £10 on the Mac App Store, for example our very own Barcode Basics.


    Link to Mac App Store to purchase Barcode Basics - Mac barcode software

    Barcodes are the work of Satan

    We can see how you might think that if you’ve ever been a supermarket checkout assistant and tried to scan a Cadbury’s Creme Egg. Seriously though, do those codes ever scan?

    Some barcodes are just never going to scan...

    Some barcodes are just never going to scan…

    However, an urban myth has long circulated that “666” (regarded by religious types and Iron Maiden fans as a Satanic number) is encoded into every barcode. Apart from being one of the dumbest urban myths on the face of the Earth, it’s also just basically not true. Read more about how this myth came about over at Wired.

    So, to summarise, barcodes are not the work of Beelzebub, don’t include any mysterious secret information and are relatively easy to create yourself!

    01 Jul

    Ten ways to avoid costly barcode errors

    The world of barcodes can be confusing for us designers. It’s stuffed full of jargon and confusing technical language and, frankly, it’s not too exciting. However, its important to know your stuff because mistakes can be costly and embarrassing. Luckily, barcode errors can be easily avoided if you remember a few details…

    1. Talk to your printer

    No, not your trusty inkjet… However, if you’re planning on sending your files to a commercial printer for printing on a press then communication is key. Speak to your printer and ask them for barcode specs. At the very least, they should be able to tell you bar width reduction, minimum bar height (aka truncation) and scale (aka magnification).

    2. Think about colour contrast

    Contrast is everything in barcodes. You want as big a contrast between the bars of your barcode and the colour its printed on. If possible, go for a black barcode on a white background and you shouldn’t have any problems.

    If you must colour your barcode then avoid colouring it red at all costs. The laser that scans barcodes is red too so red codes almost certainly won’t scan. Aim for nice dark bars on a light background and you shouldn’t go too far wrong. If you’re unsure, print some test codes in your planned colours and try scanning them.

    Aim for good colour contrast. Avoid red bars at all costs.

    Aim for good colour contrast. Avoid red bars at all costs.

    3. Don’t mess with the font

    Barcode fonts are usually OCR-B or Helvetica. It’s possible to change the font as you see fit without stopping the code from being scanned, although we’d strongly recommend against it. If you change the font, make sure the text is still easily readable by the human eye – if your code doesn’t scan, someone is going to have to read and type that number!

    4. Make sure you get the bar height right

    This is sometimes called truncation. In short, its the height of the bars that make up the code. Generally codes will have a bar height of between 12-16mm. If the bar height is too small then your code may not scan. Again, its always best to check with your printer to see what specifications are needed.

    5. Positioning

    Think about where your barcode goes on your artwork. If its on curve, e.g. on a can then make sure the bars go with the curve of the can. If possible, put the barcode where it’s unlikely to get crumpled or distorted.

    Barcodes on curved surfaces should be positioned so the bars follow the curve.

    Barcodes on curved surfaces should be positioned so the bars follow the curve.

    6. Quiet Zones

    A quiet zone is an imaginary border around the bars of your code. You shouldn’t have anything printed in that area. No text. No graphics. Nothing. If you print anything in the quiet zone it can confuse a barcode reader and your code may not scan. Generally speaking, 2-3mm is plenty. If in any doubt, it’s better to have too big a quiet zone than to small. The minimum quiet zone is sometimes indicated by a ‘light margin indicator’ on some bar codes. This is usually a ‘>’ symbol to the left and/or right of the code number.

    7. Test your code

    Print your code out and scan it to make sure it works. There are free apps for iOS and Android e.g. Zbar which will at least verify that the code is readable and contains the right number/text. There are also more expensive solutions for industry.

    8. Avoid barcode fonts

    Its possible to buy barcode fonts where you simply type your number in, change the font to your barcode font and hey presto, you have a barcode. These are not professional solutions. Avoid them! You cannot add bar width reduction which rules out production on most professional presses. Also, you may have issues if you send your document to someone who doesn’t have your font. Or worse, someone who has a subtly different version of your barcode font.

    9. Don’t distort the code

    Once you’ve created your code in your barcode software (did we mention that Barcode Basics for Mac OS X is a rather excellent barcode generator?), resist the temptation to scale it, stretch it, warp it etc. If you find you need a bigger or smaller code then regenerate it and replace it.

    10. Use a reputable barcode generator

    You tend to get what you pay for… to a certain extent. There are free barcode solutions but they are usually font based which means they’re not useful for serious work (see the section on avoiding barcode fonts above). However, don’t be fooled into spending a fortune on an app stuffed full of functions you’ll never use. Apps such as our own Barcode Basics will do the job for under $10.

    Some barcodes are just never going to scan... make sure the  numbers are legible

    Some barcodes are just never going to scan…