Can anyone tell me if I can create something like this with some of the command line utilities?
So far, I've used this: "montage -mode concatenate 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png" but it's not exactly what I'm looking for.

That is the method I was using on my old gallery index page using php and an extra image with the blocks of colour for the map and imagecoloratThat background masking file can also be used to generate a website 'which image' hit map, (Can't seem to find the reference!)
I thought it was you, but as I could not find it, I could not verify it. Perhaps you like to write up the technique for others to follow it more clearly.Bonzo wrote:That is the method I was using on my old gallery index page using php and an extra image with the blocks of colour for the map and imagecoloratThat background masking file can also be used to generate a website 'which image' hit map, (Can't seem to find the reference!)
Looks like I have removed the example from my website but Iif the OP is interested I could see if I could find it.
Currently I have no idea what " bitshifting and masking " means but for a blue I had to use:If PHP is compiled against GD library 2.0 or higher and the image is a truecolor image, this function returns the RGB value of that pixel as integer. Use bitshifting and masking to access the distinct red, green and blue component values
Code: Select all
elseif ($rgb > '131' & $rgb < '167')
Example of bit shift and bit maskingBonzo wrote:One thing I notice though is the colour selected can not be exact but has to have some tolerance which I pressume is due to the way ImageColorAt works.
According to the php website:Currently I have no idea what " bitshifting and masking " means but for a blue I had to use:If PHP is compiled against GD library 2.0 or higher and the image is a truecolor image, this function returns the RGB value of that pixel as integer. Use bitshifting and masking to access the distinct red, green and blue component valuesCode: Select all
elseif ($rgb > '131' & $rgb < '167')
IM automatically converts known image file formats to its internal Quality level. So it does all the bit shifting! That of course will also ruin the actual input Truecolor value, whcih I presume you are using as an index. You would need to convert that value back to true color values to extract the image index.Bonzo wrote:I wonder if IM can get the colour quickly and not rely on ImageColorAt as we can pass the coordinates of the pixel to IM to find the colour? Anyway I will write an example and that can be looked into later.
The method I used was to create the image with the photos and have another image with blocks of colour the same size and position as the photos. When the user clicks on the photo the x and y position was passed in the URL and the code checked what colour was at that position on the second image. The correct URL was selected depending on the colour value.convert rose:[1x1+10+10] -format "%[fx:round(255*u.b)]" info:
57
or
convert rose:[1x1+10+10] -format "%[fx:round(255*u.r)],%[fx:round(255*u.g)],%[fx:round(255*u.b)]" info:
72,64,57
yes having too much overlap is the problem with any randomised image layout.fmw42 wrote:The only issue might be that a larger image may almost totally overlap a smaller image, whether randomized or not. I have not given this too much thought, yet. So the above is just a rough idea to consider or critique.