gradient:
" syntax to provide extra options
would also be good. For example (posibility only) gradient:'red=.1-green=.3-blue=.9, 1,1, 50,90'These are suggestions for the future development for IM. They are currently not being developed but have been requested my myself and other users on the IM mail lists and web forum. Some of these may never be developed, others may not be provided until a new major version number release of IM. Some may appear next week! If you feel you can help, you can attempt to program these into IM and send the patches to Crisy. I am sure he wold welcome them.
-histogram-stretch
" operator which normalizes the image so
that the given percentage of the brightest and darkest pixels are pegged to
black and white. That is, a single odd white or black pixel will not majorly
effect the overall result.
A "-linear-stretch
" operator was also added recently.
A simpler and linear transformation can be effective if one computes the linear transformation from a formula that uses desired mean and standard deviations along with the image's actual mean and standard deviation. That was why I was asking if you have a function that can extract the images mean and standard deviation (as well as the min and max values). Something like "-identify or info:" but more of an image statistics function that would report these values per channel. This could be very useful.I have yet to find a real-world use for "
-equalize
"
-contrast-stretch
" operator normalizes images using the peak color
values in the image, then moving those points inward by the percentages given.
This provides a more controled normalize.
Current Recommended Solution...
Linear 'stretching' methods should be able to... For example woring with 8bit values and image with min = 100 and max = 200 (make it easy) and a autolevel parameter of say 20 (units). 1/ find the max and min values than move inward by 'percentage' so min+20 max-20 => level 120,180 (black/white point arguments are 'color values') 2/ cut off 20 pixel values from each end of the histogram (black/white point arguments are 'pixels') 3/ select the value of the first bin from each end where the number of values in the exceeds 20 (the height of the bin) (black/white point arguments are 'pixels per bin') Also note that histograms have multiple types. separate color channels, grayscale, all values luminance (HSL colorspace) Once the points have been determined (per channel or combined channels) then the 'level' routines can be used to do the 'stretch' (as per -level). Implementation should separate the generation of histogram data that can then be used by various histogram modification methods. Including the posibility of the data of one image being used for a completely different image! Data output should correctly handle 8-bit histogram output (existing bug). The data can also be used to generate, histogram gradients, cumultive histogram gradients. Also we should be able to do gradient graphing (profile generation), rather than using external image generating applications. The data will also be used for equalize, and equalize-gaussian, histogram re-distribution, as well as histogram thresholding methods, and histogram segmentation.
Hmmmmm.... I wonder if we can change the histogram: usage. That is, histogram: currently outputs a simple normalized LUT histogram (one row) and also we add cumulative: to output a normalize cumulative histogram. BUT we also add graph: which graphs a LUT image! Now that would be great! It can even follow the techniques that you developed in your "profile" script. Or the displacement graphing technique I developed. Better still lets take all this OUT of the output and make them operations. -histogram -cumulative -graph Now this would be great!!! Of course they can still contain a comment listing the actual value counts. We would need to be careful of both operations when a IM Q8 is used or the upper values could be clipped when the data is saved back into a image. 8bits means a maximum count of 255! That is, not very many pixels! A solid color 16x16 image could exceed that! As such some expert otpions to control... * number of bins * height of the histogram (clipping to prevent high peaks) Actual value or based on image_size/number_of_bins * scaling of the histogram (especially for Q8 versions) + automatic so maximum value maps to quantum range + fixed N pixels to 1 value in histogram (1:1 default) A cumulative function would probbaly need to be normalised to work. After all a 256x256 pixel count would fill a 16 bit value, unless HDRI is actually used.
-radial-blur
" and
"-motion-blur
"
as generic blur operations.
First of all "-radial-blur
" is miss-named, as it is really a
rotational blur. A radial blur would blur out from the center point of the
image or region, not in a circle around that point.
Secondally these speciallised blurs are only the start of a whole set of blur
type operations that should be made available. And implementing as a single
option per blur type woudl produce far too many options. It needs to be
consolidated before new types of blurs are introduced.
I can see 7 types of special blurs...
Type | Direction | Description |
---|---|---|
linear | one direction | like -motion-blur |
linear | both directions | like a 1d blur, but at any angle) |
rotational | one direction | like a electron around an atom |
rotational | both directions | like -radial-blur |
radial | out of | small circles would look like asteroids speeding from the center |
radial | into | things heading toward the center |
radial | both in & out |
-special-blur {type} {radius}x{sigma}+{dir}+{angle}Where...
-depth 4
" only results in 8 bit images, not 4 bit images.
Of course that is only valid if the image format and IM even allows
the use of 'depths' for that image format.
These depth/quantium restriction is becoming a problem for many image formats
such as NetPBM, TXT (IM pixel enumeration), BMP, TIFF... etc..
magick -size 1x1000 gradient: -define pbmplus:quantum=1000 t.pgm P2 1 1000 999 999 998 997 ... 3 2 1 0Where all image data values are in the 0 to 999 inclusive range. If defined the setting overrides -depth
-gravity
" alignment, until
"-size
" width, is
reached. The line is then horizontally -gravity justified, and padded to the
"-size
" width. When
the height of all the lines exceeds a optionally given "-size
" height, a new 'page'
image is started, but pages are not padded, which will allow vertical
justification using "-extent
" using a different gravity setting.
Similarly for a 'columns' layout method but vertically, down the 'page'
images, being generated.
The "+/-append
"
operator could be classed as a special type of layout method. One in which
"-size
" is not used.
Other posible layout methods could include 'best fit into page' using various
2D 'napsack packing' algorithms, though that may mix up the order of the
images so as to produce the smallest number of 'pages'.
See topic Re: Informal but
coherent montage for a 'randomized layout' idea.
All methods however should record and keep track of the location each image
ended up, for the purpose of 'HTML' image map generation, though it may be
implemented as part of the image 'layering' rather than the specific layout
method. Something that "montage" currently does but which goes wrong in its
'concatenate' mode.
The above does NOT need to deal with frames, borders, captions, labels as
these should be taken care of by pre-layout operations.
How a 'general layout' operator (or command, like "montage") should work. 1. Prepare images (rotations, framing, lables, and other 'fluff') This is generally external to the 'layout' method. 2. initial placement of images ( randomly cover background completely, form rows, columns, arcs, spirals, etc) Limits of placement (unlimited, or width, height limits, shaped area)? 3. optional adjustment of placements (minimise overlap, remove excess images such as those that go off the edge, or completely covered by other images) 4. re-order the image layering (input order, top/bottom/left/right placement order, center uppermost, edge uppermost, randomize) 5. output results.... * flatten/mosaic/merge (generating the display image) (shadow handling may be added here) * generate imagemaps (for color index mapping) * generate imagemap table (color index, rectangular positions, to image name or link)Note that all but the final step is really about generating a image placement list, and may only involve the images as part of that processing.
magick montage
" will
be, and it has, many times, been suggested that some sort of output size
control added.
That is, specify a final size and geometry size, and let montage work out the
tiling, (and perhaps geometry spacing) to produce however many pages are
nessary. Of course if the width of the individual tiles (as determined by
-geometry is more that the final output size, then all bets are off, and a
warning probably should be issued.
Or, specify the final size and number of tiles, then let montage work out
the geometry needed. What algorithm should be used for figuring out tile size
verses tile spacing is another matter, particularly when labels and framing
also needs to taken into account.
It may be that in both cases some extra boarder space will be required to
'pad out' the image to the exact image size requested, as a variable geometry
or tile setting may not generate an exact fit.
At the moment there is no defined method of setting a final output image size.
Also what should "magick montage
" do if all three (size, tile, geometry)
is given.
-tile
" as meaning a 'fit to this
size if posible' setting. Of course the -tile setting (and extra boarder
space) would then be the variable part of the montage generator.
EG: "-tile 800x600\!
" would mean that montage will try to adjust
the tile counts to form pages that fit into a final image of this size.
OR: "-tile 800x\!
" will only adjust the number of columns
to fit into 800 pixels, in a single page of appropriate length.
Some extra spacing may have to be added to the edges to handle any remaining
space that can't be assorbed by the tile geometry size or spacing.
NOTE: This option is probably better implemented using core routines
to replace montage completely. "Convert script?"
magick montage
" to allow user
defined hard or soft shadows in a simular way that the new
"magick
", "-shadow
" operator does.
No suggestions as to implimentation, as "magick montage
" "-shadow
" setting should probably
remain a boolean on/off operator, unless it is added as part of a major
version number release.
Simularly add some extra framing controls, would be nice if more that a single
number is given.
gravity_setting default justification attributes undefined Left Baseline (Top for images) North Center Top South Center Bottom East Right Middle West Left Middle Center Center Middle ... other gravity settings as appropriate ...Note that 'Baseline' has no meaning for image justification. But if specifically given for an images it should probably be equal to either 'Bottom', 'Middle' or prehaps to align with text better, 1/3 from the Bottom.
---- Additional thoughts. Really for good positioning (composition) of anything (images or text) there are lots of factors, which could be important to its final location. gravity (positioning on background image, with X,Y coord) placement (how the 'rectangle' should be placed relative to that position, could also have a X,Y coord) scale/rotate justification (how text is arranged within its 'box') That last is actually text to image creation The first we have already (but doing 'placement' as well) All but justification are essentually SRT distort (no gravity). But gravity can be calculated (relative to destination image)
https://imagemagick.org/Usage/bugs/future/