{"id":41719,"date":"2021-08-17T10:53:46","date_gmt":"2021-08-17T08:53:46","guid":{"rendered":"https:\/\/eiposgrados.com\/?p=41719"},"modified":"2021-10-29T16:10:28","modified_gmt":"2021-10-29T14:10:28","slug":"python-to-convert-png-to-jpg","status":"publish","type":"post","link":"https:\/\/eiposgrados.com\/eng\/blog-python\/python-para-convertir-png-a-jpg\/","title":{"rendered":"Python app to convert PNG to JPG"},"content":{"rendered":"<p>Today we bring you a simple script with which you can convert any <strong>PNG file to JPG<\/strong> simply with two clicks. It&#039;s a <strong>very simple code<\/strong> where through an interaction window we can select the PNG file and convert it to JPG by pressing a button.<\/p>\n\n\n\n<p>training with him <a href=\"https:\/\/eiposgrados.com\/eng\/master-in-python\/\" data-type=\"URL\" data-id=\"https:\/\/eiposgrados.com\/master-en-python\/\">Master in Advanced Programming in Python for BigData, Hacking and Machine Learning <\/a>You will learn about topics like the one we discuss in this post in depth and you will be an expert in this field. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to take to convert a PNG file to JPG<\/h2>\n\n\n\n<p><strong>We start<\/strong> creating the window of our application, giving it format, size and indicating its text.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/eiposgrados.com\/wp-content\/uploads\/2021\/08\/convertir-png-a-jpg-1024x228.png\" alt=\"python app to convert png to jpg\" class=\"wp-image-41721\" width=\"764\" height=\"170\" title=\"\"><\/figure><\/div>\n\n\n\n<p>Then we create a<strong> function to select the PNG <\/strong>and we format the button. In our case we wanted to give it that retro touch of a Windows pop-up window with blue and gray tones.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/eiposgrados.com\/wp-content\/uploads\/2021\/08\/aplicacion-python-para-convertir-png-a-jpg-1024x330.png\" alt=\"\" class=\"wp-image-41722\" width=\"759\" height=\"244\" title=\"\"><\/figure><\/div>\n\n\n\n<p>Finally we create another <strong>function to convert PNG to JPG<\/strong> and we also format the button.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/eiposgrados.com\/wp-content\/uploads\/2021\/08\/python-para-convertir-png-a-jpg-1024x295.png\" alt=\"\" class=\"wp-image-41723\" width=\"764\" height=\"219\" title=\"\"><\/figure><\/div>\n\n\n\n<p>And once <strong>we execute it<\/strong> We can see our application to convert PNG to JPG with two simple clicks.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/eiposgrados.com\/wp-content\/uploads\/2021\/08\/conversion-de-archivos.png\" alt=\"\" class=\"wp-image-41724\" width=\"380\" height=\"362\" title=\"\"><\/figure><\/div>","protected":false},"excerpt":{"rendered":"<p>Python application to convert PNG to JPG. It is a very simple code where through an interaction window we can select the PNG file and convert it to JPG by pressing a button. <\/p>","protected":false},"author":1,"featured_media":51569,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[407],"tags":[],"class_list":["post-41719","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-python"],"acf":[],"_links":{"self":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts\/41719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/comments?post=41719"}],"version-history":[{"count":0,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts\/41719\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/media\/51569"}],"wp:attachment":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/media?parent=41719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/categories?post=41719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/tags?post=41719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}