openatv / enigma2

openatv-gui
GNU General Public License v2.0
200 stars 317 forks source link

png to jpg #2490

Closed Belfagor2005 closed 2 years ago

Belfagor2005 commented 2 years ago

https://github.com/openatv/enigma2/blob/7fa13508ee20c8f3f4df96dcffab547c36ca4274/lib/python/Screens/LocaleSelection.py#L179

I was wondering, if it was possible to lighten the images, using the jpg format as well as the .png of the files like cowntry and more

obviously the same goes for ValueToPixmap https://github.com/openatv/enigma2/blob/a269bc103ee4de118791d17120bed002dbedf430/lib/python/Components/Converter/ValueToPixmap.py

I hope I have not said nonsense, I hope it can be done, it would reduce the work on the skinners and the work of the box by a lot in percentage

Regards

jbleyel commented 2 years ago

Please note jpg is not transparent and cannot be used in many screens.

Belfagor2005 commented 2 years ago

so it is for this reason I understand. good job, thanks for answering me Regards my fiend

wedebe commented 2 years ago

Png is superior to jpg for image sharpness and file size when it comes to shapes, lines and text, which makes the format most suited to country flags, icons and picons ;)

wedebe commented 2 years ago

@Belfagor2005 , when you say lighten, are you referring to image brightness?

Belfagor2005 commented 2 years ago

or sorry for my english, i didn't mean to lighten but also to import jpg I had also done a test and it worked fine. When it comes to pngs I do not doubt that it is better, but the weight is certainly 300% more than the jpg. Then for small images like cowntri etc .. I don't t in screens folder - LocaleSelection.zip in converter folderValueToPixmap.zip hink it's a problem. They are only seen in the wizard .. So I am attaching my test I'd let the skinner choose what to wear

jbleyel commented 2 years ago

jpg has lower size but it's not transparent and this will look very bad if your screen is transparent.

Belfagor2005 commented 2 years ago

yes of course, but so in the cowntry section, and only in that, we could do without png, we could use a trick for transparency I believe in the skin, but this would surely help us to save up to 6-8 megabytes of png .. I hope not to be wrong

jbleyel commented 2 years ago

What images do you mean?

Belfagor2005 commented 2 years ago

on my box open atv 6.4 is this what you want to know?

jbleyel commented 2 years ago

on my box open atv 6.4 is this what you want to know?

NO .. what png image files do you mean?

Belfagor2005 commented 2 years ago

the files in the cowntry folder, but not only those, in the skin folders there are many folders with png, I would like the skinner to choose what to load and how to load it. It is clear that if there is no transparency it will put a png and not a jpg Where needed you could put a .jpg For this, I mean, you could put both png and jpg into the development regards

wedebe commented 2 years ago

Have the png files been optimised (by using, for eg. ImageOptim)?

Belfagor2005 commented 2 years ago

yes, I already use it, but, the more I optimize, the more quality is lost However, if it can't be done, there is certainly a good reason. I was thinking only of an "enlarged" check, if there is no png look for jpg, everyone will put PNG, maybe I'll just put JPG, or who knows, maybe many other skinners too. Thank you. of your time, you are always available.

wedebe commented 2 years ago

Could you attach a sample image - original and optimised? And if possible a screenshot of the Enigma2 screen it appears on?

Belfagor2005 commented 2 years ago

ok as soon as my wife frees the tv :(

jbleyel commented 2 years ago

Do you mean these images ?

https://github.com/oe-alliance/oe-alliance-e2-skindefault/tree/master/skin_default/countries

This folder contains aprox. 500KB and not 6 MB.

Belfagor2005 commented 2 years ago

:) fold

jbleyel commented 2 years ago

I donno what you are doing.

Bildschirmfoto 2022-08-24 um 22 06 27
wedebe commented 2 years ago

Which image version are you using, @Belfagor2005 ? The images shown don't match up with what we see in the repo.

However, yours could certainly have the right side & bottom shadows cropped, to be added (as you've suggested) by the skin. In fact, any effects like this should be applied by the skin so that each skin designer is completely free to apply any effects they wish (or none at all). This is the principal of web development too - css is applied to create effects (shadows/rounding/emboss etc.)

Which leads me to say that the oe-alliance-e2-skindefault repo should really only have 'flat' imagery, with the button effect added at skin-level. Furthermore, an ImageOptim execution on the repo returns the result Saved 45 KB out of 436 KB. 11.3% per file on average (up to 61.1%).

Belfagor2005 commented 2 years ago

no problem my friend.. mine was just a question that you have abundantly answered, and I thank you for that. the fact that PNG is imposed and that you can't also put JPG on just for transparency doesn't mean you can't do it. I am not using official PNGs, but I use a different system but perhaps it is not appropriate for ATV Image

Thanks for the answers

wedebe commented 2 years ago

OpenATV's MetrixHD skin repo contains the following:

https://github.com/openatv/MetrixHD/tree/dev/usr/share/enigma2/MetrixHD/FHD/countries

IanSav commented 2 years ago

@Belfagor2005 the images you posted are always going to be a size issue as they have a lot of texture detail that will need to be stored.

There is NOTHING stopping you from making a skin and using any images you like. The main issue you will hit is that most of the Enigma2 code assumes, and hard codes, that most images will have a ".png" extension. While this can be changed it will require some strong supporting requirements to justify the effort and performance costs in finding the correct images. Please note that one or two flags are not standard rectangles and may be created with a transparent element.

I have created a set of flags to be used in Enigma2. I can make the quite large so that the hardware display renderer can rescale the image to suit any of the common resolution skins. You may care to make similar allowances. An image without all the texture can compress to be quite small.

@wedebe how do I add shadow, rounding and emboss effects to an image in the skin?

Belfagor2005 commented 2 years ago

I have well understood the work behind a development. I am attaching the requested images.I got the answers I was looking for and that's okay, God forbid, I don't insist because I know that it is difficult to share so much information fi fi he requested images.I got the answers I was looking for and that's okay, God forbid, I don't insist because I know that it is difficult to share so much information

Thank's

IanSav commented 2 years ago

May I ask why you want such intricate flag images when you only see the flags in the Locale/Language selection screen? It seems like a lot of work for little return.

To try and find you some more options I had a discussion with another developer to see what we could suggest. We did come up with the idea of having a simple flat flag image and then overlay that image with a mostly transparent image which could offer some of the visual effects you desire. That idea won't work for flags like the one you just posted as the flag you posted is distorted.

I am out of ideas for you.