-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Repeated change in color causes current wallpaper degradation #66
Comments
Good point, some problem with image quality when resizing or saving. I never noticed because I always call it with the wallpaper path to my "vanilla" file. |
The tool being able to echo the current state might be helpful as we'd be able to capture that in a script and go back to the previous state. Maybe I need to just hunker down and learn some applescript or figure out how to do it in python or bash. If I wrote Swift I'd contribute more than just feedback 😂 I'm a backend eng though |
I also do not run ChangeMenuBarColor on the vanilla image, but on the wallpaper set in system preferences. I just flip between dark mode and normal mode (I have a bash script that reads the dark mode option of macOS and then colors the menu bar different) on this wallpaper. I think it is mainly caused by the resizedWallpaper() method that creates a fresh image from the old image then rescale it and crop it. While this procedure is needed to do on the 1st run on the original image that not fits the screen size it is not needed to do on a 2nd, 3rd and 4th run since from the 2nd run onwards the image size already fits the screen size. So I added some if else cases to SolidColor.swift and Gradient.swift to run resizedWallpaper() only when the image size differs from the screen size. See this commit here: de2c7dc For my wallpaper this helped that the image stays scarper and also the file size no longer gets smaller each run. On contrary the file size now increases over time. While this fix surely can not completely fixes any degradation of the image since we still change it on each run it seams at least to mitigate the degradation effect. |
I think the problem is the image operations reduce the quality, but I am not sure which ones exactly, the export is set to no compression, etc. This is a good improvement, reducing the number of image operations when they are not needed. I pushed the changes. |
This is what the wallpaper looks like after 200 executions
The text was updated successfully, but these errors were encountered: