Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
fmw42 wrote: ↑2017-01-28T15:16:19-07:00
If you need more input images, just append them first and use that as the reference image. If you need to apply one image's color to many output images, then you would need to write a script over all the output images.
I need to input more images to from which the color will be transferred to, while there is still a single image that the color is applied to. The later can be done by running the script more than once.
Does the convert command accept images separated by commas? And can you explain how your code snipped works? I don't really have experience with the -append parameter and "miff". Are you creating a ".miff" image that is composed multiple images, to use with the script?
Are you creating a ".miff" image that is composed multiple images, to use with the script?
Yes, it just stacks them vertically into one new image in miff format. Then the miff image is piped to the script as input. I have not tested the pipe into transfercolor. It may not work. If that is the case, then you will need to append and save the result as a new image in a non-compressed format, such as PNG or TIFF or even as a named miff file (imagename.miff). Then call transfercolor in a second command using the named image as input rather than the pipe input from the "-" (minus sign).
See http://www.imagemagick.org/Usage/layers/#append. I assume all your images are the same size. If not, then the append will pad with whatever color you want and that may change the statistics.
If you do not have same sized inputs, then I will have to modify the script to gather statistics from multiple images and merge them into one mean and std.
The piping does not work. So you will have to make it two commands. The first to append and save to an output image. And the second to use transfercolor.
fmw42 wrote:I assume all your images are the same size. If not, then the append will pad with whatever color you want and that may change the statistics.
Instead of appending entire images, the inputs can be chopped into lines, and these appended horizontally. This creates a wide Nx1 image, with no "invented" pixels.
If your images are not the same size, you can still append them with a transparent background to fill in. I can then modify my script to compute the mean and std so as to ignore the transparent pixels. Let me know if this is needed.
snibgo wrote:Instead of appending entire images, the inputs can be chopped into lines, and these appended horizontally
Good point. But it may be better to use -append, since some image formats restrict to some maximum width. However, one could save to miff format in this case, since I don't think miff has that restriction. I do not know about PNG.
So there are now at least two ways to solve the issue.
IM doesn't like images wider than 10,000,000 pixels (on my computer). For some statistics, resizing or scaling down first will give good-enough results.
fmw42 wrote: ↑2017-01-28T18:36:28-07:00
If your images are not the same size, you can still append them with a transparent background to fill in. I can then modify my script to compute the mean and std so as to ignore the transparent pixels. Let me know if this is needed.
For the airplane image and the other image, I used 3 gigapixel style images from Google's Art Project that are: 30000x20922 30000x20857 30000x18840, in size. But the sizes can change if I am using different style images, and I have used 245 styles in one case before, but using that many style images is probably more of an extreme use case. So I guess that modifying the script is the best option at the moment.
fmw42 wrote:I assume all your images are the same size. If not, then the append will pad with whatever color you want and that may change the statistics.
Instead of appending entire images, the inputs can be chopped into lines, and these appended horizontally. This creates a wide Nx1 image, with no "invented" pixels.
I suggest you resize so the input is no more than, say, 100,000 pixels. For calculating mean and standard deviation, this won't make a significant difference.
snibgo wrote: ↑2017-01-28T19:20:36-07:00
I suggest you resize so the input is no more than, say, 100,000 pixels. For calculating mean and standard deviation, this won't make a significant difference.
You list linecolor.png in the first convert command, but you use line.png in the transfercolor script. Are these the same images?
I do not know if it will make a difference or not unless I change it. But what snibgo said is true, small changes in the statistics won't really make much difference. So if all your convert input images have very close statistics, the results from using only one and from using all of them won't be too different. You should look at the mean and std of each of your input images using
Send me your direct email address (via PM on the forum if you want it private) and I will email your a modified version of the script that ignores transparency in the input images when computing statistics, so that you can append image of different sizes with transparent background. I will let you experiment and if it works, then I will modify the documentation to reflect the changes.
fmw42 wrote: ↑2017-01-28T20:47:28-07:00
You list linecolor.png in the first convert command, but you use line.png in the transfercolor script. Are these the same images?
They are the same image.
fmw42 wrote: ↑2017-01-28T20:47:28-07:00
So if all your convert input images have very close statistics, the results from using only one and from using all of them won't be too different. You should look at the mean and std of each of your input images using
Also when comparing your result, you should look at the result and the individual tiles at the same scale factor.
Ok, I'll try looking at the mean and std.
fmw42 wrote: ↑2017-01-28T20:53:52-07:00
Send me your direct email address (via PM on the forum if you want it private) and I will email your a modified version of the script that ignores transparency in the input images when computing statistics, so that you can append image of different sizes with transparent background. I will let you experiment and if it works, then I will modify the documentation to reflect the changes.
fmw42 wrote: ↑2017-01-28T20:47:28-07:00
So if all your convert input images have very close statistics, the results from using only one and from using all of them won't be too different. You should look at the mean and std of each of your input images using
The 3rd image has a weird URL due to Russian characters in the name.
I used the 30,000 image version (the largest one) for the style images, but the size might not be important? I'll see about getting the outputs for the style images.