I have 6 images of circles, in different colours. These 6 images are then repeated in a specific order to make a 72 by 72 image. For more background information see here: http://www.jfmamjjasonp.co.uk/mm/mastermind.htm
I've created the images in JPG format. I then use ImageMagick from the command prompt on Windows. I have to create the image in 4 quarters, otherwise it exceeds the 8190 characters allowed. I use the following command:
Montage input1.jpg input2.jpg … input1296.jpg -mode Concatenate output1.jpg
I then join my 4 quarters in an image editor, to create the final image. All looks fine on screen. However, when I've got this printed, the colours are not the same - some are not even close. I now understand that the reason for this is because the image is using RGB colours, whilst the printer uses CMYK colours, and sometimes the encoding of this isn't a great match.
So I'm now trying to do the same as the above, but using image files saved in CMYK format. However, when I use the Montage command on these files, the output file has the colours inverted. When I undo this invert, the colours are close, but not the same as the input files. I've tried this with both TIF and JPG files, but the same result happens. If I leave out "-mode Concatenate", then the gaps between the images is white, but everything else is inverted.
Can ImageMagick cope with files with CMYK colours? If so, what do I need to do differently to the above?
Is there a cleverer way to create the required image than the method I am using?
Problems with CYMK colours
Problems with CYMK colours
Last edited by Jap72 on 2014-11-03T07:22:02-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Problems with CYMK colours
Why are you using JPG? Please don't. JPEG mangles colours. With flat colours, which I suppose yours are, it really mangles them.Jap72 wrote:I've created the images in JPG format....
Montage input1.jpg input2.jpg … input1296.jpg -mode Concatenate output1.jpg
Rule of thumb: never use JPEG for anything. Nothing at all. Never ever. Take it out of your toolbox and throw it out of the window. If you ever see a JPEG file, delete it. Banish JPEGs from your computer.
snibgo's IM pages: im.snibgo.com
Re: Problems with CYMK colours
Thanks for your reply. I promise not to use them going forward.
I have tried CMYK colours in both TIF and JPG formats, but the problem is the same.
I have tried CMYK colours in both TIF and JPG formats, but the problem is the same.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Problems with CYMK colours
Ok, good. I wouldn't use CMYK. You want 72x72 coloured circles on a white background. Here is how I would do it. A single command:
This creates an image 1000x1000 pixels. The actual dimensions you want will be different. It then draws on this image, taking instructions from a file named circs.txt. Then it save the image as circs.png. You could use tiff instead of png.
circs.txt contains:
This draws three circles. You would need 5184.
The first circle is red, centred at (30,30), with one perimeter point at (30,50). Thus it has a radius of 20 pixels, a diameter of 40 pixels.
The next circle is 40 pixels to the right. And the third is another 40 pixels over.
Keep going for 5184 circles.
Of course, writing circs.txt by hand would be a pain. I would write it as a script, with one loop nested in another, calculating the numbers. Or you might do it in a spreadsheet, or from a database program.
Did I mention? Don't use JPEG.
Code: Select all
convert -size 1000x1000 xc:White -draw @circs.txt circs.png
circs.txt contains:
Code: Select all
fill Red circle 30,30 30,50
fill Green circle 70,30 70,50
fill Blue circle 110,30 110,50
The first circle is red, centred at (30,30), with one perimeter point at (30,50). Thus it has a radius of 20 pixels, a diameter of 40 pixels.
The next circle is 40 pixels to the right. And the third is another 40 pixels over.
Keep going for 5184 circles.
Of course, writing circs.txt by hand would be a pain. I would write it as a script, with one loop nested in another, calculating the numbers. Or you might do it in a spreadsheet, or from a database program.
Did I mention? Don't use JPEG.
snibgo's IM pages: im.snibgo.com
Re: Problems with CYMK colours
That's great, thank you. The data is in Excel, so I can easily create a file with 5184 rows, and the appropriate location and colour for the circle. I'll give it a go.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Problems with CYMK colours
Another couple of hints:
1. I've written the colours above as names: Red, Green, etc. Sometimes I prefer to write them as RGB numbers, eg #f00, #ff0, etc. This allows me to easily tweak them. For example, yellow on white might seem too light, so I might tweak it to #cc0 or something.
2. If your printer is attached to your computer, it will almost certainly accept RGB files. The printer driver may have an "intent" option. Set this to "saturation" for saturated colours.
1. I've written the colours above as names: Red, Green, etc. Sometimes I prefer to write them as RGB numbers, eg #f00, #ff0, etc. This allows me to easily tweak them. For example, yellow on white might seem too light, so I might tweak it to #cc0 or something.
2. If your printer is attached to your computer, it will almost certainly accept RGB files. The printer driver may have an "intent" option. Set this to "saturation" for saturated colours.
snibgo's IM pages: im.snibgo.com