Skip to content

Commit e35e9a8

Browse files
Reduce memory usage in pixel map
1 parent 35d55b5 commit e35e9a8

127 files changed

Lines changed: 251 additions & 251 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/ImageSharp/Processing/Processors/Quantization/EuclideanPixelMap{TPixel}.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ private static float DistanceSquared(Rgba32 a, Rgba32 b)
184184
/// The granularity of the cache has been determined based upon the current
185185
/// suite of test images and provides the lowest possible memory usage while
186186
/// providing enough match accuracy.
187-
/// Entry count is currently limited to 4601025 entries (8MB).
187+
/// Entry count is currently limited to 2335905 entries (4MB).
188188
/// </para>
189189
/// </remarks>
190190
private unsafe struct ColorDistanceCache : IDisposable
191191
{
192192
private const int IndexRBits = 5;
193193
private const int IndexGBits = 5;
194-
private const int IndexBBits = 6;
194+
private const int IndexBBits = 5;
195195
private const int IndexABits = 6;
196196
private const int IndexRCount = (1 << IndexRBits) + 1;
197197
private const int IndexGCount = (1 << IndexGBits) + 1;

tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ public void Encode_AnimatedFormatTransform_FromGif<TPixel>(TestImageProvider<TPi
499499
// TODO: Find a better way to compare.
500500
// The image has been visually checked but the quantization pattern used in the png encoder
501501
// means we cannot use an exact comparison nor replicate using the quantizing processor.
502-
ImageComparer.TolerantPercentage(0.12f).VerifySimilarity(output, image);
502+
ImageComparer.TolerantPercentage(0.46f).VerifySimilarity(output, image);
503503

504504
GifMetadata gif = image.Metadata.GetGifMetadata();
505505
PngMetadata png = output.Metadata.GetPngMetadata();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:23a9d9233314ec08bd3e464f245e69d96566cbb12d2dba36c69bba483d6ba6b8
2+
oid sha256:11375b15df083d98335f4a4baf0717e7fdd6b21ab2132a6815cadc787ac17e7d
33
size 9270
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:3052831cb18fecc26f54e29dfe19b538d2e0d3c104ddd7ec5bc8e0adcf56693c
2+
oid sha256:e063e97cd8a000de6830adcc3961a7dc41785d40cd4d83af10ca38d96e071362
33
size 9270
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)