Hello folks ,
I’m “developing” or more tinkering a script together to modify the wallpaper with different information from the system and set that modified wallpaper again as background.
So far so good, but I recognized that it has losses in quality if you compare to the original one. It’s some artifacts on the wallpaper itself, but mostly on the text.
It’s also scientifically proven because the file itself is much smaller. The original file is a png
file with around 18~ MB, yes without compression, testwise. And then the modified picture from PowerShell is 9~ MB.
I also tried different formats, though I always started with original wallpaper in png
format. But the output file is changed to bmp
, bitmap, file. Didn’t help that much.
Is there any possibility to save without any compression or quality loss?
I hope I said everything important, else don’t hesitate to ask, I will try to deliver the answer to it.
Attachments:
I marked the artifacts with the arrows. As said, in general it appears around the text. When I zoom in I see also the lack of quality in the wallpaper itself and even more in the text section.
Code Snippet of image generation:
(...)
$originalImage = [System.Drawing.Bitmap]::FromFile("C:\mypath\to\original.png")
$copyImage = $originalImage.Clone()
$graphics = [System.Drawing.Graphics]::FromImage($copyImage)
$graphics.CompositingQuality = [System.Drawing.Drawing2D.CompositingQuality]::HighQuality
$graphics.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality
$graphics.DrawString($text, $font, $brush, ($copyImage.Width - 500), ($copyImage.Height - 300))
$graphics.Dispose()
$copyImage.Save("C:\path\to\modified\background.bmp", [System.Drawing.Imaging.ImageFormat]::Bmp)
(...)
Those code snippets are tinkered together from the internet documentations and forums I found.
Notice 01
Im not a powershell expert and would say im a bloody beginner, but with motivation to learn it. I’m home at the python corner and also there I would say I’m im somewhere in the beginner section. I would say I have a general understanding of programming/scripting but not that much of knowledge of the language itself whats possible or not or how to program more efficient, yet.I may set my own skills to low but better low than to high right?
Notice 02:
I you think that sounds like something else you already heard, your right! I try to create alternative toBgInfo
which does not work that well on my machine.