@@ -3824,69 +3824,6 @@ public void Lower(uint size)
38243824 public void Magnify ( )
38253825 => _nativeInstance . Magnify ( ) ;
38263826
3827- /// <summary>
3828- /// Remap image colors with closest color from the specified colors.
3829- /// </summary>
3830- /// <param name="colors">The colors to use.</param>
3831- /// <returns>The error informaton.</returns>
3832- /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
3833- public IMagickErrorInfo Map ( IEnumerable < IMagickColor < QuantumType > > colors )
3834- {
3835- Throw . IfNull ( nameof ( colors ) , colors ) ;
3836-
3837- return Map ( colors , new QuantizeSettings ( ) ) ;
3838- }
3839-
3840- /// <summary>
3841- /// Remap image colors with closest color from the specified colors.
3842- /// </summary>
3843- /// <param name="colors">The colors to use.</param>
3844- /// <param name="settings">Quantize settings.</param>
3845- /// <returns>The error informaton.</returns>
3846- /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
3847- public IMagickErrorInfo Map ( IEnumerable < IMagickColor < QuantumType > > colors , IQuantizeSettings settings )
3848- {
3849- Throw . IfNull ( nameof ( colors ) , colors ) ;
3850-
3851- var colorList = new List < IMagickColor < QuantumType > > ( colors ) ;
3852- if ( colorList . Count == 0 )
3853- throw new ArgumentException ( "Value cannot be empty." , nameof ( colors ) ) ;
3854-
3855- using var images = new MagickImageCollection ( ) ;
3856- foreach ( var color in colorList )
3857- images . Add ( new MagickImage ( color , 1 , 1 ) ) ;
3858-
3859- using var image = images . AppendHorizontally ( ) ;
3860- return Map ( image , settings ) ;
3861- }
3862-
3863- /// <summary>
3864- /// Remap image colors with closest color from reference image.
3865- /// </summary>
3866- /// <param name="image">The image to use.</param>
3867- /// <returns>The error informaton.</returns>
3868- /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
3869- public IMagickErrorInfo Map ( IMagickImage image )
3870- => Map ( image , new QuantizeSettings ( ) ) ;
3871-
3872- /// <summary>
3873- /// Remap image colors with closest color from reference image.
3874- /// </summary>
3875- /// <param name="image">The image to use.</param>
3876- /// <param name="settings">Quantize settings.</param>
3877- /// <returns>The error informaton.</returns>
3878- /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
3879- public IMagickErrorInfo Map ( IMagickImage image , IQuantizeSettings settings )
3880- {
3881- Throw . IfNull ( nameof ( image ) , image ) ;
3882- Throw . IfNull ( nameof ( settings ) , settings ) ;
3883-
3884- if ( _nativeInstance . Map ( image , settings ) )
3885- return new MagickErrorInfo ( ) ;
3886-
3887- return CreateErrorInfo ( this ) ;
3888- }
3889-
38903827 /// <summary>
38913828 /// Delineate arbitrarily shaped clusters in the image.
38923829 /// </summary>
@@ -5088,6 +5025,69 @@ public void ReduceNoise(uint order)
50885025 public void RegionMask ( IMagickGeometry geometry )
50895026 => _nativeInstance . RegionMask ( MagickRectangle . FromGeometry ( geometry , this ) ) ;
50905027
5028+ /// <summary>
5029+ /// Remap image colors with closest color from the specified colors.
5030+ /// </summary>
5031+ /// <param name="colors">The colors to use.</param>
5032+ /// <returns>The error informaton.</returns>
5033+ /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
5034+ public IMagickErrorInfo Remap ( IEnumerable < IMagickColor < QuantumType > > colors )
5035+ {
5036+ Throw . IfNull ( nameof ( colors ) , colors ) ;
5037+
5038+ return Remap ( colors , new QuantizeSettings ( ) ) ;
5039+ }
5040+
5041+ /// <summary>
5042+ /// Remap image colors with closest color from the specified colors.
5043+ /// </summary>
5044+ /// <param name="colors">The colors to use.</param>
5045+ /// <param name="settings">Quantize settings.</param>
5046+ /// <returns>The error informaton.</returns>
5047+ /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
5048+ public IMagickErrorInfo Remap ( IEnumerable < IMagickColor < QuantumType > > colors , IQuantizeSettings settings )
5049+ {
5050+ Throw . IfNull ( nameof ( colors ) , colors ) ;
5051+
5052+ var colorList = new List < IMagickColor < QuantumType > > ( colors ) ;
5053+ if ( colorList . Count == 0 )
5054+ throw new ArgumentException ( "Value cannot be empty." , nameof ( colors ) ) ;
5055+
5056+ using var images = new MagickImageCollection ( ) ;
5057+ foreach ( var color in colorList )
5058+ images . Add ( new MagickImage ( color , 1 , 1 ) ) ;
5059+
5060+ using var image = images . AppendHorizontally ( ) ;
5061+ return Remap ( image , settings ) ;
5062+ }
5063+
5064+ /// <summary>
5065+ /// Remap image colors with closest color from reference image.
5066+ /// </summary>
5067+ /// <param name="image">The image to use.</param>
5068+ /// <returns>The error informaton.</returns>
5069+ /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
5070+ public IMagickErrorInfo Remap ( IMagickImage image )
5071+ => Remap ( image , new QuantizeSettings ( ) ) ;
5072+
5073+ /// <summary>
5074+ /// Remap image colors with closest color from reference image.
5075+ /// </summary>
5076+ /// <param name="image">The image to use.</param>
5077+ /// <param name="settings">Quantize settings.</param>
5078+ /// <returns>The error informaton.</returns>
5079+ /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
5080+ public IMagickErrorInfo Remap ( IMagickImage image , IQuantizeSettings settings )
5081+ {
5082+ Throw . IfNull ( nameof ( image ) , image ) ;
5083+ Throw . IfNull ( nameof ( settings ) , settings ) ;
5084+
5085+ if ( _nativeInstance . Map ( image , settings ) )
5086+ return new MagickErrorInfo ( ) ;
5087+
5088+ return CreateErrorInfo ( this ) ;
5089+ }
5090+
50915091 /// <summary>
50925092 /// Removes the artifact with the specified name.
50935093 /// </summary>
0 commit comments