Creating a logrithmic grid?
Re: Creating a logrithmic grid?
using the last style above:
This has been useful, now the people who view this think the lines should be slanted 15 degrees or so. Say each of those lines above are 10 pixels tall, leaving the bottom of the line where it is, the top of each line should end up 3 or 4 pixels to the right.. Not a 45 degree slant like ////, but it's similar, just with a smaller angle. Something that suggests 'movement'.
The rotate commands I've tried end up doing the entirely wrong thing, I guess it's something to change in the function for the line that I'm messing up on here, though I'm still on the 'old' imagemagic. I have one system with 7.0.5-6 and one with 6.8.9-9 versions.
Is this an easy wizzard trick, or is it more complex than that? Is there a good study manual for the function with demoo's beyond fmw42's site?
This has been useful, now the people who view this think the lines should be slanted 15 degrees or so. Say each of those lines above are 10 pixels tall, leaving the bottom of the line where it is, the top of each line should end up 3 or 4 pixels to the right.. Not a 45 degree slant like ////, but it's similar, just with a smaller angle. Something that suggests 'movement'.
The rotate commands I've tried end up doing the entirely wrong thing, I guess it's something to change in the function for the line that I'm messing up on here, though I'm still on the 'old' imagemagic. I have one system with 7.0.5-6 and one with 6.8.9-9 versions.
Is this an easy wizzard trick, or is it more complex than that? Is there a good study manual for the function with demoo's beyond fmw42's site?
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Creating a logrithmic grid?
You might look at the "-shear" operator. A command like this will horizontally slant the image 15 degrees to the right...troybtj wrote: ↑2017-11-03T17:56:12-07:00The rotate commands I've tried end up doing the entirely wrong thing, I guess it's something to change in the function for the line that I'm messing up on here, though I'm still on the 'old' imagemagic. I have one system with 7.0.5-6 and one with 6.8.9-9 versions.
Is this an easy wizzard trick, or is it more complex than that? Is there a good study manual for the function with demoo's beyond fmw42's site?
Code: Select all
convert input.png -shear 15x0 output.png
Re: Creating a logrithmic grid?
Thanks! The second convert command wiped out the transparency, but found a quick workaround for that!
Commands:
Output:
For some reason, the word "skew" is the word I was thinking of but couldn't figure out when I wrote the post explaining what was needed, but my brain-thesaurus index needs rebuilding.
Once again, you've made it simple.
The hard part remaining. My Python code only has the Imagemagick 6 support. Is this something available in that using the long formats on the previous page and the skew command?
Commands:
Code: Select all
$ magick -size 1x50 xc:darkblue -duplicate 39 -scale %[fx:t+1]x50! -bordercolor none -border 5x0 -reverse +append out.png
$ convert -background transparent out.png -shear 15x0 outputs.png
For some reason, the word "skew" is the word I was thinking of but couldn't figure out when I wrote the post explaining what was needed, but my brain-thesaurus index needs rebuilding.
Once again, you've made it simple.
The hard part remaining. My Python code only has the Imagemagick 6 support. Is this something available in that using the long formats on the previous page and the skew command?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Creating a logrithmic grid?
You can do it all in one command.
Code: Select all
magick -size 1x50 xc:darkblue -duplicate 39 -scale %[fx:t+1]x50! -bordercolor none -border 5x0 -reverse +append -background transparent -shear 15x0 out.png
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Creating a logrithmic grid?
As fmw42 mentioned above, the entire process can be worked into a single command. When using IM6 you're somewhat limited using variables within the command, but it can be done. Here's a command that should produce a result nearly identical to your example using any IM6 from about 6.7.7 to current, and even IM7 by changing "convert" to "magick".
Code: Select all
convert -size 40x50 xc:#000080 -duplicate 39 -bordercolor none -background none -virtual-pixel none \
-distort SRT "0,0 %[fx:(t+1)/n],1 0 0,0" -trim -reverse -border 4x0 +append -shear 15x0 output.png
Re: Creating a logrithmic grid?
Thank you, GeeMack! That works, now I've just got to put it into the python script for text, which I've got set up.
When messing with an otherwise boring task, I love adding things like this to make it look more recent than 1980, but not too much more, and add in all sorts of useless glam here and there, so I love IM!
When messing with an otherwise boring task, I love adding things like this to make it look more recent than 1980, but not too much more, and add in all sorts of useless glam here and there, so I love IM!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Creating a logrithmic grid?
Out of curiosity, how are you convert this to Python? What tools do you use --- skimage, numpy, opencv? Or Wand or Pythonmagick? Or are you use a subprocess call to a shell script from python?
Re: Creating a logrithmic grid?
I'm now just using a shell call to bash since it's not a secure system, and I use some of your (Fred's Scripts) which I just looked and realize I need to update. For simpler stuff like resize or auto-color-correct, I've used the python-imageck library, ported from PHP.
I have looked at the python-libmagick++ which is just a wrapper to call the C++ library libmagick++ functions (lib from imagemagick.org). However, I've not found enough documentation (ok, desire to read what I have found, to be honest) to get those commands into individual calls in the right order. for this creation.
I'm now just using it as a background piece to overlay and draw text on it which is then overlaid again.
I have looked at the python-libmagick++ which is just a wrapper to call the C++ library libmagick++ functions (lib from imagemagick.org). However, I've not found enough documentation (ok, desire to read what I have found, to be honest) to get those commands into individual calls in the right order. for this creation.
I'm now just using it as a background piece to overlay and draw text on it which is then overlaid again.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Creating a logrithmic grid?
What is "python-imageck"? Did you spell that correctly? Do you have a link to it.
Re: Creating a logrithmic grid?
Sorry, I left off the link: https://secure.php.net/imagick
--ETA: That's the php version, I have no clue where I got the python wrapper for that at, titled the same.
--ETA: That's the php version, I have no clue where I got the python wrapper for that at, titled the same.