DataJuggler.PixelDatabase
8.3.6
dotnet add package DataJuggler.PixelDatabase --version 8.3.6
NuGet\Install-Package DataJuggler.PixelDatabase -Version 8.3.6
<PackageReference Include="DataJuggler.PixelDatabase" Version="8.3.6" />
paket add DataJuggler.PixelDatabase --version 8.3.6
#r "nuget: DataJuggler.PixelDatabase, 8.3.6"
// Install DataJuggler.PixelDatabase as a Cake Addin #addin nuget:?package=DataJuggler.PixelDatabase&version=8.3.6 // Install DataJuggler.PixelDatabase as a Cake Tool #tool nuget:?package=DataJuggler.PixelDatabase&version=8.3.6
PixelDatabase
11.5.2024: I fixed a bug where the CreateNew was not setting the background image. This was caused by when I added a default Criteria of Alpha > 0 so most queries only affect the visible part of an image. This also fixes the Show query.
// Simple Show query, will set the alpha value to 255 for all pixels
string query = "Show";"
// Update
PixelQuery pixelQuery = pixelDatabase.ApplyQuery(query, null);
// test the results
int pixelUpdated = pixelQuery.PixelsUpdated;
11.3.2024: I added a new method to PixelDatabase called CreateNew. This creates a new Bitmap and loads a pixeldatabase for the Width and Height givne. I also added a new DrawLine method to simplify Line drawing.
7.24.2024: RandomShuffler and UltimateHelper were updated. I also added a new method Clone, whiich creates a copy of a PixelDatase. Untested.
2.28.2024: I moved the Title of each calendar up 8 pixels.
2.27.2024: I now draw a line between Header and Day Roy Image. If no Day Row Image, it is still a horizontal line 1 vertical pixel below the header.
2.26.2024: I changed NuGet PixelDatabase.CreateCalendar to accept a BaseFont and a HeaderFont. It is a breaking change, but I figure now is the time to break this method since it is new. Also added an optional parameter as of a pixel database for the day row image. This is the row where the day names are abbreviated.
2.23.2024: I added a new method to PixelDatabase - CreateCalendar, which takes in an argument for a Month and a Year. View the demo project here: https://github.com/DataJuggler/CalendarCreator
2.16.2024: PixelDatabase.DrawLine and DrawRepeatingLine were updated. A Bitmap is now returned from the methods, so you can get the updates that were applied.
12.7.2023: New Properties - MaxBlueDifference, MaxGreenDifference, MaxRedDifference. This allows you to query on positive numbers, verse RedMaxDifference made you work with negative numbers and it is a little unnatural feeling.
11.22.2023: UltimateHelper was updated.
11.18.2023 Version 8.0.0: This project has been updated to .NET Core 8.0.0.
7.5.2023: I added a Rescale image, which returns the dimensions for a new image by passing in a MaxWidth and MaxHeight value, and the code determins the ratio by taking the lowest of ratio x and ratio y. To actually resize the image, call Resize. I am using this new method in DataJuggler.BlazorGallery project for the FullScreenImageViewer component. Live sample (https://blazorgallery.com).
4.24.2023: I found a better method of resizing an image, and wrote a new Resize method that returns a loaded PixelDatabase at the new size.
Update 4.23.2023: The current version is 7.0.7. I added a Resize method which returns a PixelDatabase loaded with the new size. There was already a ResizeImage, but this method makes it easier for use with PixelDatabase.
PixelDatabase.Net is now live: https://pixeldatabase.net A Free Online Text Based Image Editor
I am starting a batch version of this project now because I need it for videos.
Please visit my YouTube channel, as I make videos for PixelDatabase.Net as often as I can: https://www.youtube.com/channel/DataJuggler
This class library and Nuget package was built as part of my project TransparencyMaker. I created this library so I can build a Blazor version for a domain I just bought today called PixelDatabase.
The documentation below is copied from Transparency Maker.
Here is the link to TransparencyMaker:
https://github.com/DataJuggler/TransparencyMaker
Most of this is applicable to this project now that it has been ported to a class library, I just copied and pasted for now to save time. I apologize in advance, but this is better than none.
Motivation
The reason I wrote Transparency Maker originally is when I purchase stock photos, almost all come with a background color and often I need a transparent background. There are other tools that perform background removal, with more now than in 2012 when I started working on Transparency Maker, however I wanted a way to programmaticaly manipulate pixels.
Rebranding the name to Pixel Database (done for the Nuget package)
The original purpose of Transparency Maker was to make backgrounds transparent, thus the name. I have now expanded the features to include updating pixels, changing colors, etc.
I am continuing testing, the rest of these docs use caution some are specific to the Windows Form app, and some are in the class library / Nuget package DataJuggler.PixelDatabase.
All the functionality that can be done in TransparencyMaker can be done in PixelDatabase, except for Set Background Color, that is specific to Transparency Maker. Updated documenation coming soon.
Visual Studio
Visual Studio 2019 is required, version 16.4+.
Transparency Maker Videos on my Channel (new videos coming as soon as today)
https://www.youtube.com/playlist?list=PLKrW5tXCPiX2PxrLPszDzlcEZwQG-Qb8r
I just updated my channel to be split into more play lists to separate each section.
How PixelDatabase Works
The first thing that happens when an image is opened, is your file is parsed into a list of PixelInformation objects, aka Pixel Database.
When the program starts, click the Start button to select your image. The image must be a Png or a Jpg.
<img src="https://github.com/DataJuggler/TransparencyMaker/blob/master/Docs/ScreenShot.png">
A Pixel Database is a List of PixelInformation objects that contain properties about the pixel. To find the pixel information for any pixel, turn the Color Picker on.
<img src="https://github.com/DataJuggler/TransparencyMaker/blob/master/Docs/ColorPicker.png">
Tip: To determiine if the Color Picker is on, hover your mouse of any part of your image. If the mouse cursor turns into a pointer (a hand), then the Color Picker is on.
Once the Color Picker is turned on, click any pixel in your image and a Pixel Information Box pops up:
<img src="https://github.com/DataJuggler/TransparencyMaker/blob/master/Docs/PixelInfoBox.png">
The box contains the following properties:
Red
The Red value of RGB value. Value range is 0 - 255.
Green
The Green value of RGB value. Value range is 0 - 255.
Blue
The Blue value of RGB value. Value range is 0 - 255.
Alpha
The Transparency Level of the pixel. Values are 0 - 255, where 0 is transparent and 255 is visible.
X
The horizontal position of the pixel clicked.
GreenRed
The sum of Green plus Red.
BlueGreen
The sum of Blue plus Green.
BlueRed
The sum of Blue plus Red.
Total
The sum of Red plus Green plus Blue.
Y
The vertical position of the pixel clicked.
You can use all of the above values in your queries to manipulate your image.
BQL - Bitmap Query Language
Why BQL?
This application started out as a plain Windows Form that I would hard code C# statements to replace the background of stock photos with transparent backgrounds. Over time I switched to a more object oriented approach where I analyze the entire image, and thus the Pixel Database was created.
The initial criticism I have received is there are not any controls like most graphic programs. If that is what everyone still wants I am open to ideas about what types of controls are needed. I created BQL because it is similar to SQL that many C# developers already know, thus enabling them to get up to speed quickly. Another reason I created BQL instead of a control based graphical UI is time to develop. Many of my failed endeavors have involved very complicated UI's, and then I am reminded of this small company called Google that started with a webpage that contained a single textbox and a button.
Hide / Show vs Update Queries
There are two types of queries; Hide/Show and Update.
Hide / Show
Hide
Any pixels affected by the query will be set to Alpha 0, which makes them invisible.
Example
Hide Pixels Where
Total > 700
Shortcut: Hide
Hide Pixels Where can be shortened to:
Hide<br/> Total > 700
Show
Any pixels affected by the query will be set to Alpha 255, which makes them visible.
Example
Show Pixels Where
Red < 200
Shortcut: Show
Show Pixels Where can be shortened to:
Show<br/> Red < 200
Important
This query parser may be rewritten to be more robust someday, but for now certain attributes must be on their own line. I wrote the query parser in a few hours many years ago, and it works pretty well so I have not bothered to refactor it (yet).
So the query above would fail if written like this
Invalid
Show X < 150
Correct
Show<br/> X < 150
It wouldn't be that hard to rewrite the query parser, so let me know if you think the line by line requirement is confusing. I know it is crude, but this app was designed to be quick, dirty and functional at first.
Operators
Equals
Equals Symbol: =
Will match criteria on exact values.
Equal Example:
Hide<br/> Red = 233
All pixels that have a Red value of 233 will be set to Alpha 0 to be hidden.
Greater Than
Greater Than Symbol: >
Will match criterian on greater than or equal to
Greater Than Example
Show<br/> Y > 1200
All pixels with a Y value of 1,200 or higher wil be set to Alpha 255 to be shown.
Less Than
Less Than Symbol: <
Will match criteria on less than or equal to
Less Than Example
Hide<br/> BlueGreen < 300
All pixels with a BlueGreen value of 300 or less wil be set to Alpha 0 to be hidden.
Between
Will match criteria that is greater than or equal to the first number and less than or equal to the second number.
Between Example
Hide<br/> Blue Between 200 255
All pixels with a Blue value between 200 and 255 will be hidden.
Compound Statements
You can combine criteria to further narrow down the pixels that are manipulated
Important: Each criteria must be on its own line.
Update Queries
Update queries are very similar to Hide queries, except that you must include a Color attribute
Set Color
There are two ways to set a color, Named Colors or RGB values.
Named Color
You can set a pixel to a named color
Note: For a list of Dot Net Colors see System.Drawing.Colors or this website lists them: http://www.flounder.com/csharp_color_table.htm
Named Color Example
Update<br/> Set Color FireRed<br/> Where<br/> Total Between 125 150<br/>
Note: Where must be on its own line for Update queries
RGB Color
You set the color by specifying the Red, Green and Blue values
RGB Color Example
Update<br/> Set Color 121 220 7<br/> Where<br/> Y > 100<br/>
Where is not optional
You must specify the Where, even if you want to update all pixels
Update<br/> Set Color White<br/> Where<br/> Total > 0<br/>
Note: In the above example, all pixels will be set to white, since greater than > is equal to > or equal to.
New Feature: 2.22.2020 - Added Adjust color feature
The adjust color feature lets you adjust 1 color (Red, Green or Blue) or all colors by a certain amount.
Example: Update Set Adjust Red 25 Where Total > 0
Negative Color Example
The Adjustment value can also be negative.
Update Set Adjust All -15 Where Total > 0
All pixels will be adjusted by 15, so Red = 33, will become red = 18.
It is safe to apply a value as if a color channel of a pixel goes over 255 the value will be 255, or below 0 will be 0.
New Feature 2.23.2020: Swap (color)
I added a new useful feature called Swap, that let you replace the value of Red With Blue, Red With Green or Green With Blue, and of course the opposite of swap is the same; green to blue is the same as blue to green.
Swap Example:
Update Set Swap Red Blue Where Total > 0
The above query will replace the value of Pixel.Red with Pixel.Blue for all pixels in the image (again greater than > is the same as greater than or equal in BQL.
Swap is safe to use, in terms of if you have a pixel with a vlue of blue 30, and you subtract 50, the resulting value of blue will be zero, not -20. The same is true for adding over the max value of a color (255), the value will be set to 255. One problem with swap and values going out of bounds is the contrast created by slight variances give an image a different look, compared to all pixels being the same color. Some information in your image will be lost if you go below zero or above the maximum for many pixels.
New Feature 2.23.2020: Masks
Masks is something I have thought about for a long time. Today I worked on a sample and some unwanted pixels kept getting modified with my query, so I got motivated and created a new property to the PixelInformationObject called Mask.
Mask Rules (This is the my guide for programming them, and is created as I code this).
Masks will stay on after being created until you load a new image, remove the mask, clear all masks or close the program.
Masks only affect Update queries for now. Hide Pixel and Show Pixel and draw line queries are not getting this feature (yet). If it works well I may apply it to the other areas later.
Mask Specification
Set Mask Verb Name
Verbs
Verbs are actions that can be performed to create, add, remove or replace masks.
Add
Add a mask and give it a name.
Example: Set Mask Add Interior
Replace
Replacing a mask removes all pixels affected by a mask, then creates a new mask for the pixels affected. Example: Set Mask Replace Mailbox
If any pixels had a Mask applied named Mailbox, they would be removed, and then a new mask named Mask Mailbox is created for the pixels affected in the update query.
Clear
Remove a mask by name.
Example: Set Mask Clear Fence.
Clear (All)
To remove all masks, pass in the name All.
Set Mask Clear All
Note: Clear and Clear All may require you to still pass in a valid where clause. If yes, You can use:
Update Set Mask Clear Curb Where Total > 0
When I start testing this I will try and document what is actually expected, and if possible I would like to get rid of the required Where clause. It should mean everything from the Select like SQL.
Disabling a Mask
If you want to keep a mask on an image, but want to run another query where the mask isn't active (disabled), you can run this.
Set Mask Disable Bookshelf
To enable the query again:
Set Mask Enable Bookshelf.
Hiding / Showing a Mask
By default, Masks are not visible, but a query to show them is as simple:
Show A Mask:
Update Set Mask Show Name
Hide A Mask:
Update Set Mask Hide Name
Set Mask Color
By default, Masks are displayed in White. You can change this by setting the MaskColor property.
Set MaskColor Color Name
Color must be a .Net Named Color. If you are not sure, use the small box of Crayon colors like Red, Blue, Orange, etc. Name is the name of the Masque to set the MaskColor.
Example: Set MaskColor Turquoise PianoKeys
Note: You must set the MaskColor property prior to showing the Mask.
Masks Are Being Developed Now
I needed to write this somewhere to code it, and by writing it here first I don't have to come back and write it again.
Normalizing An Image
One of the uses of Transparency Maker is an image that is grainy or pixelated, you can smooth out an area by setting all pixels in a range to a certain value.
Update<br/> Set Color 220 0 55<br/> Where<br/> Total Between 525 590<br/> X Between 200 360<br/> Y > 400<br/>
Drawing Transparent Lines
To Draw a Transparent Line, Type The Following
Line 1: Draw Line LineThickness<br/> Line 2: First two points are Line Start Point X Y<br/> Second two points are Line End Point X Y<br/> Line 3 (Optional): Repeat Direction Iterations Move<br/>
Draw Line 4<br/> 161 125 457 66<br/> Repeat Down 15 1<br/>
Tip: Line 2 can be filled in for you using the Color Picker
Type Line 1 Draw Line (Thickness), then hit enter to place your cursor on the next line. Ensuriing the Color Picker is toggled on, Click on your image to establish Point 1:
Draw Line 4<br/> 161 125
Then click your mouse again for the end point of the line:
Draw Line 4<br/> 161 125 457 66
(Optional) Type line 3 if you want to repeat.
Then click Apply.
Draw Line 4<br/> 161 125 457 66<br/> Repeat Down 15 1<br/>
Repeat Directions
Use with Repeat with Down, Up, Left and Right
Repeat Up Example
Draw Line 2<br/> 0 64 457 66<br/> Repeat Up 100 2<br/>
The above line will be drawn 100 times, and each time it will move the Y coordinate up (minus) two pixels.
Note: The line will go futher than the bounds of the image, so Repeat 50 would accomplish the same thing.
Repeat Left Example
Draw Line 1<br/> 225 412 105 430<br/> Repeat Left 25 2<br/>
The above line will be drawn 25 times and will move the StartPoint.X and EndPoint.X left two pixels each iteration.
Repeat Right Example
Draw Line 5<br/> 140 300 90 600<br/> Repeat Right 50 10<br/>
The above line will draw transparent stripes through an image because the Repeat Move (last parameter) is greater than the line thickness from Line 1.
Draw Transparent Lines Are Slow In Large Images
Drawing transparent lines is slower than any other operation using Transparency Maker because what it actually does is create a copy of the source image and draws a line trhough the copy in a color that doesn't exist in the copy, then creates a Pixel Database out of the copy image and determines which pixels were modified. The pixels that were modified in the copy are then applied to the source Pixel Database and set to Transparent.
I think this is a good candidate for letting people with a powerful GPU take advantage of this, but I haven't learned how to apply this yet. I have a 1080 TI, but I have never written any code to take advantage of a GPU. Volunteers anyone?
Masks
Known Issues
Clicking Save sometimes causes an error. You can think click Continue, and are returned to your image. Click Save As works.
Upcoming Features
It has been on my list for a long time to add a Save prompt if there are changes and you attempt to close the file or the application.
Let me know what features you think are needed or any feedback you may have.
Draw Line In Color
I thought I had code to draw a line in a specific color, but this has not been done yet apparently. It will be coming soon.
If anyone wants this feature let me know.
Any suggestions or feedback is welcome.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- DataJuggler.RandomShuffler (>= 8.0.7)
- System.Drawing.Common (>= 8.0.10)
- System.Drawing.Primitives (>= 4.3.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DataJuggler.PixelDatabase:
Package | Downloads |
---|---|
DataJuggler.BlazorGallery
A project template for creating a Blazor Image Gallery project that uses SQL Server for a backend. You will need SQL Server or SQL Server Express to run this project. See the Read Me for more info. Watch this video to see a demo https://youtu.be/yQz1dqYiy2g. |
|
DataJuggler.AudioTools
DataJuggler.AudioTools makes it simple to draw a Wave file image in C#. NAudio is used to read audio files and DataJuggler.PixelDatabase is used to create the wave images. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.3.6 | 302 | 11/5/2024 |
8.3.5 | 77 | 11/5/2024 |
8.3.4 | 92 | 11/5/2024 |
8.3.3 | 62 | 11/4/2024 |
8.3.2 | 79 | 11/3/2024 |
8.3.1 | 73 | 11/3/2024 |
8.3.0 | 73 | 11/3/2024 |
8.2.16 | 77 | 11/3/2024 |
8.2.15 | 116 | 7/24/2024 |
8.2.14 | 81 | 7/24/2024 |
8.2.12 | 71 | 7/24/2024 |
8.2.11 | 53 | 7/24/2024 |
8.2.10 | 121 | 6/16/2024 |
8.2.9 | 114 | 6/15/2024 |
8.2.8 | 128 | 5/26/2024 |
8.2.7 | 190 | 2/28/2024 |
8.2.6 | 128 | 2/27/2024 |
8.2.5 | 128 | 2/26/2024 |
8.2.4 | 116 | 2/26/2024 |
8.2.3 | 118 | 2/26/2024 |
8.2.2 | 123 | 2/26/2024 |
8.2.1 | 110 | 2/24/2024 |
8.2.0 | 124 | 2/24/2024 |
8.1.3 | 130 | 2/17/2024 |
8.1.2 | 128 | 2/16/2024 |
8.1.1 | 244 | 12/9/2023 |
8.1.0 | 136 | 12/7/2023 |
8.0.1 | 141 | 11/22/2023 |
8.0.0 | 129 | 11/19/2023 |
7.0.9 | 218 | 7/12/2023 |
7.0.8 | 219 | 4/24/2023 |
7.0.7 | 217 | 4/23/2023 |
7.0.6 | 353 | 1/10/2023 |
7.0.5 | 458 | 11/30/2022 |
7.0.4 | 381 | 11/9/2022 |
7.0.4-rc1 | 126 | 10/28/2022 |
7.0.3-rc1 | 126 | 10/25/2022 |
7.0.2-rc1 | 134 | 10/21/2022 |
7.0.1-rc1 | 143 | 10/21/2022 |
7.0.0-rc1 | 186 | 10/20/2022 |
6.2.1 | 515 | 7/12/2022 |
6.2.0 | 461 | 7/12/2022 |
6.1.5 | 499 | 1/23/2022 |
6.1.4 | 301 | 1/4/2022 |
6.1.3 | 301 | 12/31/2021 |
6.1.2 | 311 | 12/11/2021 |
6.1.1 | 502 | 12/11/2021 |
6.1.0 | 298 | 12/11/2021 |
6.0.7 | 319 | 11/17/2021 |
6.0.6 | 400 | 11/13/2021 |
6.0.5 | 332 | 11/13/2021 |
6.0.4 | 365 | 11/13/2021 |
6.0.3 | 335 | 11/13/2021 |
6.0.2 | 335 | 11/13/2021 |
6.0.1 | 329 | 11/11/2021 |
6.0.0 | 351 | 11/11/2021 |
5.1.12 | 383 | 10/6/2021 |
5.1.11 | 395 | 10/6/2021 |
5.1.10 | 354 | 8/24/2021 |
5.1.9 | 351 | 8/24/2021 |
5.1.8 | 350 | 8/24/2021 |
5.1.7 | 355 | 8/24/2021 |
5.1.6 | 419 | 8/22/2021 |
5.1.5 | 396 | 8/21/2021 |
5.1.4 | 408 | 8/18/2021 |
5.1.3 | 385 | 8/17/2021 |
5.1.2 | 367 | 8/15/2021 |
5.1.1 | 364 | 8/15/2021 |
5.1.0 | 353 | 8/11/2021 |
5.0.0 | 312 | 11/11/2021 |
1.6.1 | 352 | 8/11/2021 |
1.6.0 | 391 | 6/28/2021 |
1.5.0.3 | 414 | 4/24/2021 |
1.5.0.2 | 437 | 2/12/2021 |
1.5.0.1 | 416 | 2/12/2021 |
1.3.1 | 452 | 11/13/2020 |
1.3.0 | 430 | 11/13/2020 |
1.2.2 | 622 | 8/15/2020 |
1.2.0 | 641 | 7/11/2020 |
1.1.6 | 537 | 7/9/2020 |
1.1.5 | 511 | 7/8/2020 |
1.1.4 | 600 | 6/12/2020 |
1.1.3 | 493 | 6/12/2020 |
1.1.2 | 516 | 6/11/2020 |
1.1.1 | 503 | 6/11/2020 |
1.1.0 | 527 | 4/21/2020 |
1.0.7 | 484 | 4/15/2020 |
1.0.6 | 620 | 4/8/2020 |
1.0.5 | 539 | 3/11/2020 |
1.0.4 | 512 | 3/6/2020 |
1.0.3 | 556 | 3/1/2020 |
1.0.2 | 609 | 3/1/2020 |
1.0.1 | 601 | 3/1/2020 |
1.0.0 | 571 | 3/1/2020 |
11.22.2023: UltimateHelper was updated.
11.18.2023
Version 8.0.0: This project has been updated to 8.0.0.
7.5.2023: I added a Rescale image, which returns the dimensions for a new image by passing in a
MaxWidth and MaxHeight value, and the code determins the ratio by taking the lowest of ratio x
and ratio y. To actually resize the image, call Resize. I am using this new method in
DataJuggler.BlazorGallery project for the FullScreenImageViewer component.
Live sample (https://blazorgallery.com/).
4.24.2023: I found a better method of resizing an image, and wrote a new Resize method that returns
a loaded PixelDatabase at the new size.
1.10.2023: I now check for null before calling back to the StatusUpdate delegate.
11.30.2022: I upgraded the way ImageClassification Works. My old method actually sorted wrong by color
name was faoving lower average colors.
11.8.2022: This project has been updated for .NET 7. Use a 6.x version for .NET 6. All new development will
be on the .NET 7 version.
10.25.2022: Gradient.CalculateBlue was returning 0 hard coded. I guess I never finished that.
10.21.2022: This version has been updated for .NET7. It listed as pre-release until .NET7 is out
of preview.
7.12.2022: I removed ImageProcessor. I didn't realize it was a .NET Framework project.
I will learn how to do saturation with Primitives.
12.11.2021: I am trying again to target only .Net6.0.
12.11.2021: I added two overrides to the DrawText method to make it a little easier to call.
12.10.2021
Version 6.1.0: I added a DrawText method.
11.17.2021
Version 6.0.7: I changed the project to multi-target .Net5 and .Net6. The problem seems to occur in
AspNet.Core.Components in my site PixelDatabase.Net.
I made a few semi-breaking changes, which is I changed the calculation for the following properties:
BlueAverageDifference
BlueMaxDifference
GreenAverageDifference
GreenMaxDifference
RedAverageDifference
RedMaxDifference
I made this change, because the name is confusing compared to the calculation, and even I got confused so hopefully
this simplifies it. The only property that is a little confusing, is MinMaxDifference still takes Max - Min, but I justify
this by Abs(Min - Max) is the same as Max - Min.
11.13.2021 (Take Five)
Version 6.0.6: Last and final fix to get Grayscale working. I had a bug in PixelQueryParser caused by
copied code that set TakeMax to TakeMin. Fixed.
11.13.2021 (Take Four)
Version 6.0.5: I wrote the GetMaxColor method, but I forgot to call it. Now it works for Set Grayscale Max.
11.13.2021 (Take Three)
Version 6.0.4: Set Grayscale now works for Average (default), Red, Green, Blue, Min, Max and Mean.
11.13.2021 (Take Two)
Version 6.0.3: Putting back to Any CPU. My mouse changed it to
x64 and Visual Studio didn't like it.
11.13.2021
Version 6.0.2: I added some new options for Set Grayscale for Min, Max and Mean.
11.11.2021: Back to .Net 5.0, as .Net 6.0 doesn't work at this time.
11.10.2021: 6.0 version now targets .Net 6.0.
10.6.2021
5.1.12: The previous version had a critical flaw, so please do not use version 5.1.11. I was trying to fix
the Alpha items getting updated on queries, and broke everything due to a copy and paste and not reading
that the Criteria List was being recreated. Now this is fixed, and the Alpha bug is fixed (finally!).
A new update to PixelDatabase.Net website is coming now.
10.6.2021
5.1.11: I now append Alpha > 1 in all queries that don't have anything to do with Alpha.
Testing any impact, but I have been adding Alpha > 2 to my queries for a while so this should solve that.
5.1.10: After getting Draw River working, it wasn't worth it, so I took it out. I have a lot of ideas, not all are good.
5.1.9: DrawRiverLeftToRight had an infinite loop. Fixed.
5.1.8: I had made a couple of mistakes on the 5.1.7 release. DrawRiver might work now.
5.1.7: I added a new method DrawRiver, and you pass in a color and a direction.
5.1.6: I added an optional parameter called FastSoftFactor to ImageClassifier.Sort() methods.
If FastSortFactor is passed in, the program will compare every 'x' pixel, where x equals fastSortFactor.
5.1.5: I added a new Sort feature, you can sort an entire directory of images by color with one line of code.
ImageClassifier.Sort(sourceFolder, outputFolder, UpdateStatus);
5.1.4: Turned out the resize image I copied was private. I changed it to public. Sorry about that.
5.1.3: I added a resize image function.
5.1.2: I fixed a bug with CopySubImage where I was testing the subImage had to be smaller height, width, where in fact it can the same size also. I changed less than to less than or equal to.
5.1.1: I added 2 new methods
1. CopySubImage
2. SaveAs
5.1.0: I added a Gradient feature
Update
Create Gradient
Set Color1 Orange X Y
Set Color2 225 50 120 X Y
1.6.0: I added a new feature called SplitImage.
Update
SplitImage TakeLeft 2490
In the above example, the left half of the image is split to make a full head copy of the good side of an image, used for Character Creator Headshot Plugin.
1.5.0.2: This time it will work. Things are going to change. I can feel it.
1.5.0.1: I tried something that didn't work.
1.3.1: After I published 1.3.0 I realized System.Graphics.Common was updated from
4.7 to 5.0, so I updated that library.
1.3.0: This version was converted to .Net5. No other code changes were made at this time.
1.2.2: I fixed the way the PixelQueryParser works, and in theory I made it better.
I also added short cuts so you you can now type MinMaxDiff instead of MinMaxDifference - 6 less pixels, and much easier to spell. This applies to all the Differences: BlueGreenDiff, BlueRedDiff, GreenRedDiff, and MinMaxDiff.
1.2.1: I removed .Net Standard 2.1, since the only purpose for .Net Standard was to allow .Net Framework and .Net Core to work together, but in 3.1 .Net Framework and .Net Core parted for good. If anyone needs it I can put it back.
Also I added two new features for Scatter and Normalize.
1.2.0: I added a couple of new features and fixed some bugs with the callback delegates if they were null.
New methods:
CreateSubImage - The PixelDatabase must be loaded, pass in the TopLeft point and the rectange size.
SearchForSubImage - This method returns a SearchResult object with the TopLeft point.
class SearchResult - This class contains a Point and a Score. It has a confidence property, but I haven't coded it yet.
Here is a sample project you can use that takes a screen shot and you click the canvas (PictureBox)
containing the image to create sub images.
There is also a Search Mode that demonstrates searching for an image in another image.
https://github.com/DataJuggler/SubImageCreator
Code is new, so use at your own risk. I have a sample project on GitHub to test this that takes a screen
shot and you can click the picture of the screenshot to create sub images. All more of a test than anything
useful yet, but I might expand it over time.
1.1.6: Added a new method CreateSubImage. Tested and it works, but not tested very thoroughly
1.1.5: I added a new method ApplyPixel, which was added to the .Net Framework version so I can call this from a Paint.Net plug-in
1.1.4: I had to update DataJuggler.UltimateHelper.IsNumeric method to support negative numbers.
1.1.3: I removed Absolute value from BlueRedDifference, BlueGreenDifference and GreenRedDifference.
After working with these values for a few weeks, I discovered there is a difference between blue - red and red - blue, sometimes.
1.1.2: I fixed a bug that has been bugging me for days. Now you apply a color:
Update
Set Color 98 125 86
I had forgot to set the property SetColor to true.
1.1.1: I have been working with PixelDatabase.Net website, so quite a few chagnes needed to be checked in.
1.1.0: I discovered in my initial testing that the old way was using 7 gigs of memory to hold a list of
millions of PixelInformation objects. Now I do the BQL comparisons without instantiating tons of objects and
the memory foot print went down to under 300 meg for a Blazor website with a 20 meg image loaded.
1.0.7: I am publishing the version that is going to be on my website https://pixeldatabase.net/.
This version includes many new properties on a PixelInformation object, such as:
1. Min
2. Max
3. Average
4. MinMaxDiff
5. RedMinDiff
6. RedMaxDiff
7. RedAverageDiff
8. GreenMinDiff
9. GreenMaxDiff
10. GreenAverageDiff
11. BlueMinDiff
12. BlueMaxDiff
13. BlueAverageDiff
These should all work for queries such as:
Hide Pixels Where
MinMaxDiff > 25
Or
Update
Set Swap Blue Red
Where
RedMinDiff < 10
Diff is a shortcut for Difference. Previous docs may use Difference, and I am trying
to replace them as I see them.
1.0.6: I have been working on this project for several weeks, and I need to update Nuget.
1.0.5: I fixed a bug where Swap Colors was not taking the Alpha into account from the previous color.
1.0.4: I made some changes while working on the .Net Framework version, and I am trying to keep them in sync. The changes involved I added a new draw line in color feature, a new feature for LastUpdate can always be queried by:
Update
blah blah blah
Where
Pixels In LastUpdate
Also some changes to the Draw Line, which is still very slow, but now a message shows.
I need to create an abort for Draw Line, just haven't had a chance yet. I will work on this some more next week.
1.0.3: I added a new override to PixelDatabaseLoder for ImageUrl.
1.0.2: I had forgot to list the Project Url, as well as the description changed from untested, to lightly tested.
1.0.1: Changed TargetFramework netcoreapp3.1 to TargetFrameworks netstandard2.1;netcoreapp3.1
First release, i will update the rest of the info if it gets past proof of concept.