{"id":17309841,"url":"https://github.com/eliotjones/biggustave","last_synced_at":"2025-04-14T13:32:13.616Z","repository":{"id":44375189,"uuid":"177337712","full_name":"EliotJones/BigGustave","owner":"EliotJones","description":"C# .NET Standard PNG decoder and PNG library","archived":false,"fork":false,"pushed_at":"2024-07-23T10:37:46.000Z","size":6012,"stargazers_count":92,"open_issues_count":9,"forks_count":22,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T18:17:09.414Z","etag":null,"topics":["csharp","png"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EliotJones.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-23T20:37:42.000Z","updated_at":"2025-04-09T09:34:31.000Z","dependencies_parsed_at":"2023-10-14T15:55:40.160Z","dependency_job_id":"7a934277-c6a0-4dad-a36a-e8d4cf1fc239","html_url":"https://github.com/EliotJones/BigGustave","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliotJones%2FBigGustave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliotJones%2FBigGustave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliotJones%2FBigGustave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliotJones%2FBigGustave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EliotJones","download_url":"https://codeload.github.com/EliotJones/BigGustave/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248888756,"owners_count":21178100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","png"],"created_at":"2024-10-15T12:32:59.470Z","updated_at":"2025-04-14T13:32:11.769Z","avatar_url":"https://github.com/EliotJones.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Big Gustave\n\n![NuGet](https://img.shields.io/nuget/dt/BigGustave?style=flat-square)\n\n#### Open, read and create PNG images in fully managed C#.\n\n## Usage - **Reading**\n\nTo open a PNG image from a file and get some pixel values:\n\n```csharp\nusing (var stream = File.OpenRead(@\"C:\\my\\file\\path\\file.png\"))\n    {\n        Png image = Png.Open(stream);\n\n        Pixel pixel = image.GetPixel(image.Width - 1, image.Height - 1);\n\n        int pixelRedAverage = 0;\n\n        pixelRedAverage += pixel.R;\n\n        pixel = image.GetPixel(0, 0);\n\n        pixelRedAverage += pixel.R;\n\n        Console.WriteLine(pixelRedAverage / 2.0);\n\n    }\n```\n\n#### The PNG object has multiple methods to inspect the header and get the pixel values. The header has properties for:\n------\n\n```csharp\npng.Header.Width\npng.Header.Height\npng.Header.BitDepth\npng.Header.ColorType\npng.Header.CompressionMethod\npng.Header.FilterMethod\npng.Header.InterlaceMethod\n```\n------\n\n**The PNG also has `Width`and `Height` as convenience properties from the header information:**\n\n```csharp\npng.Width == png.Header.Width\npng.Height == png.Header.Height\n```\n\n**And a property that indicates whether the image uses transparency:**\n\n```csharp\npng.HasAlphaChannel\n```\n\n#### To get a pixel use:\n\n```csharp\nPixel pixel = png.GetPixel(0, 7);\n```\n\nWhere the first argument is x (column) and the second is y (row). The `Pixel` is used for all types of images (e.g. Grayscale, Color, with / without transparency)\n\n-----\n\n## Usage - **Creating**\n\nGenerating a PNG image:\n\n\n```csharp\nvar builder = PngBuilder.Create(2, 2, false);\n\nvar red = new Pixel(255, 0, 0);\n\nbuilder.SetPixel(red, 0, 0);\nbuilder.SetPixel(255, 120, 16, 1, 1);\n\nusing (var memory = new MemoryStream())\n    {\n        builder.Save(memory);\n\n        return memory.ToArray();\n    }\n```\n-------\n\n#### **You can load a PNG image into a builder which will copy all the pixels values into the builder for easier editing:**\n\n```csharp\nvar png = Png.Open(@\"C:\\files\\my.png\");\nvar builder = PngBuilder.FromPng(png);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliotjones%2Fbiggustave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliotjones%2Fbiggustave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliotjones%2Fbiggustave/lists"}