Page 1 of 1

How can I make a white grid.

Posted: 2015-03-21T06:13:56-07:00
by PandoraBox
Hello Everyone,

Lets say I have my image.

*****
***** All pixels are together. 5x3 grid
*****
What I would like to do I know crop can cut to 1x1 pixels however I'm trying to figure out on how to recombine to give me
* * * * *

* * * * * Split 10x6 grid

* * * * *
Spaces besides each pixel and under them. Reason for this use is that inkscape new pixel draw function gives better results in the data information is broken down first then with inkscape I can just re-glue them together?

Right now I'm using a for loop under windows to break them into horizontal lines and then add a blank line then do the same again for the vertical one. The problem with this as you might notice if it's 1024 x 768 we're close to 2000 temp files wishing for a better solution.

Thanks again.

Re: How can I make a white grid.

Posted: 2015-03-21T11:17:15-07:00
by snibgo
Doing this entirely within IM uses the same technique, but we have images in a list (in memory) instead of temporary files.

Windows BAT syntax:

Code: Select all

convert ^
  in.png ^
  -background White ^
  -crop 0x1 -splice 0x1 -append -chop 0x1 ^
  -crop 1x0 -splice 1x0 +append -chop 1x0 ^
  out.png
For the background, "none" would give transparent black.

This command adds a new line between every line, and a new column between every column, so a 5x3 input will give a 9x5 output. If you want a 10x6 output, remove the two "-chop AxB" operations.

Re: How can I make a white grid.

Posted: 2015-03-21T11:57:25-07:00
by PandoraBox
This is more than perfect just tried the results inside of Inkscape works like a charm and flawlessly. I seriously have to go through reading the source code for ImageMagick because really I feel ashamed of asking such questions. Thanks again well if your ever in Montreal,Qc. area I'll buy you a beer if you drink =)

PandoraBox

P.S: Saw your website love your work keep it up it's quite resourceful.

Re: How can I make a white grid.

Posted: 2015-03-21T12:59:17-07:00
by snibgo
Don't feel ashamed. IM is a massive system. Anyone who had memorised the contents of http://www.imagemagick.org/script/comma ... ptions.php could have answered the question. Alas, I had to cheat, and gave you a cut-down version of my blockPix.bat, which itself is an adaptation of a script by Anthony Thyssen.

But I'll happily accept a beer if I'm ever in Montreal!

Re: How can I make a white grid.

Posted: 2015-03-24T12:57:05-07:00
by PandoraBox
Sorry for the late post got a power surge that knocked my whole system down, now I'm back up and running.

I'll definitely go through your batch files as I also myself am a dos freak and learn some more IM tricks from your files.

The only PITA with good old dos is that you need lots of escapes to use ImageMagick properly.

Well thanks again and glad your accepting the offer whenever it may be =)

Re: How can I make a white grid.

Posted: 2015-03-25T11:10:40-07:00
by fmw42