-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] / [FIX] > Image Converters / Black White filter #11
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have Included a wiki directory on how to include the following library to use the function, though it produces a wrong result at the current time being, i have left the test functions as required and updated the Tasks.json / c_cpp_properties.json in the wiki.
In the following Code there was an issue that the converted image's colour was changed and the original format of the image was refused applying a blue filter on it. Which was due to the BMP colour pallet being different to the one of JPEG, which requires the use of a converter. Which was inproper.
Additionally added a line to properly convert from BMP colour variant to the PNG colour variant, previously the image turned blue. This version now Fixes it for any filtered image. (Left in the commented out Functionality for them for testing purposes). - See how to add the library in the wiki!
Additionally added a class that converts png back to a bmp format, converting the colour format of the image to proper form.
Added a function jpeg_to_bmp that converts JPEG images to BMP format. The function reads the input JPEG file, initializes a JPEG decompressor, and extracts image dimensions and pixel data. It then constructs a BMP header, calculates the BMP file size, and writes the header to the output BMP file. The JPEG pixel data is rearranged and written in RGB order to the BMP file. Padding is added as needed to align rows on a 4-byte boundary. The function ensures memory is properly managed, closes files, and provides conversion status output.
Comments not necessary in the main.c are now removed from testing.
The display had a wrong image being displayed in the code and due to that reason it was not being displayed.
Sommos
reviewed
Aug 26, 2023
Sommos
reviewed
Aug 26, 2023
Comments are now smaller than ever and are no longer capitalized
Looks good to me! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added
The following added the possibility to convert an image back to the formats, works the same as bmp to ... converters in the reverse order, the classes need refactoring, but the code as of currently works as intended, also see the Wiki on the setup of PNG library!
Modified
The problem with the following was that the converted image did not correctly convert the colour format of bmp to jpeg and png, which is not additionally fixed.
That previously either flipped the image upside down or a blue-ish filter was added to the image, each image was separately tested and the filter images were correctly converted!
Fix
[BUG] Report [BUG] - Black and White Filter #12
Issues
There is not check to see if there was an image to convert as of currently and if there was not it just returns to the main part of the code without letting you know, which could additionally be added as a check status to all of the converters!
Occasionally some filters add a few pixilation's modifications when converting from one colour format to another, but not always which might an issue with the code or the hardware!
Code requires Refactoring and better commenting!
Each conversions makes a new file, there should be something that makes the original into temp and modified, and if modified is changed again or a new filter is applied it should save another one to memory or file, instead of making new one for each time button is pressed as of currently the filters used cannot apply multiple filters!