Changing format of multiple images

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing format of multiple images

opencv-users mailing list
I want to change the format of multiple images stored in a directory.For eg. all jpg files to png files. I am using python. Still any doubt related to the above problem statement, please let me know.
 

Reply | Threaded
Open this post in threaded view
|

Re: Changing format of multiple images

opencv-users mailing list
You would have to decompress the jpg image first, then recompress it to png, possible of doing so with libjpeg and libpng libraries. You can let opencv handle it by using imread, imwrite with the different file extensions to avoid the hassle, or use boost GIL libraries and do the same thing (jpeg_read_image, followed by png_write_view).
Reply | Threaded
Open this post in threaded view
|

Re: Changing format of multiple images

opencv-users mailing list
I really appreciate your help in resolving the problem. It
 

    On Thursday, December 8, 2016 3:50 AM, "[hidden email] [OpenCV]" <[hidden email]> wrote:
 

     You would have to decompress the jpg image first, then recompress it to png, possible of doing so with libjpeg and libpng libraries. You can let opencv handle it by using imread, imwrite with the different file extensions to avoid the hassle, or use boost GIL libraries and do the same thing (jpeg_read_image, followed by png_write_view).  #yiv8992618081 -- #yiv8992618081ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv8992618081 #yiv8992618081ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv8992618081 #yiv8992618081ygrp-mkp #yiv8992618081hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv8992618081 #yiv8992618081ygrp-mkp #yiv8992618081ads {margin-bottom:10px;}#yiv8992618081 #yiv8992618081ygrp-mkp .yiv8992618081ad {padding:0 0;}#yiv8992618081 #yiv8992618081ygrp-mkp .yiv8992618081ad p {margin:0;}#yiv8992618081 #yiv8992618081ygrp-mkp .yiv8992618081ad a {color:#0000ff;text-decoration:none;}#yiv8992618081 #yiv8992618081ygrp-sponsor #yiv8992618081ygrp-lc {font-family:Arial;}#yiv8992618081 #yiv8992618081ygrp-sponsor #yiv8992618081ygrp-lc #yiv8992618081hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv8992618081 #yiv8992618081ygrp-sponsor #yiv8992618081ygrp-lc .yiv8992618081ad {margin-bottom:10px;padding:0 0;}#yiv8992618081 #yiv8992618081actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv8992618081 #yiv8992618081activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv8992618081 #yiv8992618081activity span {font-weight:700;}#yiv8992618081 #yiv8992618081activity span:first-child {text-transform:uppercase;}#yiv8992618081 #yiv8992618081activity span a {color:#5085b6;text-decoration:none;}#yiv8992618081 #yiv8992618081activity span span {color:#ff7900;}#yiv8992618081 #yiv8992618081activity span .yiv8992618081underline {text-decoration:underline;}#yiv8992618081 .yiv8992618081attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv8992618081 .yiv8992618081attach div a {text-decoration:none;}#yiv8992618081 .yiv8992618081attach img {border:none;padding-right:5px;}#yiv8992618081 .yiv8992618081attach label {display:block;margin-bottom:5px;}#yiv8992618081 .yiv8992618081attach label a {text-decoration:none;}#yiv8992618081 blockquote {margin:0 0 0 4px;}#yiv8992618081 .yiv8992618081bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv8992618081 .yiv8992618081bold a {text-decoration:none;}#yiv8992618081 dd.yiv8992618081last p a {font-family:Verdana;font-weight:700;}#yiv8992618081 dd.yiv8992618081last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv8992618081 dd.yiv8992618081last p span.yiv8992618081yshortcuts {margin-right:0;}#yiv8992618081 div.yiv8992618081attach-table div div a {text-decoration:none;}#yiv8992618081 div.yiv8992618081attach-table {width:400px;}#yiv8992618081 div.yiv8992618081file-title a, #yiv8992618081 div.yiv8992618081file-title a:active, #yiv8992618081 div.yiv8992618081file-title a:hover, #yiv8992618081 div.yiv8992618081file-title a:visited {text-decoration:none;}#yiv8992618081 div.yiv8992618081photo-title a, #yiv8992618081 div.yiv8992618081photo-title a:active, #yiv8992618081 div.yiv8992618081photo-title a:hover, #yiv8992618081 div.yiv8992618081photo-title a:visited {text-decoration:none;}#yiv8992618081 div#yiv8992618081ygrp-mlmsg #yiv8992618081ygrp-msg p a span.yiv8992618081yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv8992618081 .yiv8992618081green {color:#628c2a;}#yiv8992618081 .yiv8992618081MsoNormal {margin:0 0 0 0;}#yiv8992618081 o {font-size:0;}#yiv8992618081 #yiv8992618081photos div {float:left;width:72px;}#yiv8992618081 #yiv8992618081photos div div {border:1px solid #666666;height:62px;overflow:hidden;width:62px;}#yiv8992618081 #yiv8992618081photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv8992618081  #yiv8992618081reco-category {font-size:77%;}#yiv8992618081 #yiv8992618081reco-desc {font-size:77%;}#yiv8992618081 .yiv8992618081replbq {margin:4px;}#yiv8992618081 #yiv8992618081ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv8992618081 #yiv8992618081ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv8992618081 #yiv8992618081ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv8992618081 #yiv8992618081ygrp-mlmsg select, #yiv8992618081 input, #yiv8992618081 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv8992618081 #yiv8992618081ygrp-mlmsg pre, #yiv8992618081 code {font:115% monospace;}#yiv8992618081 #yiv8992618081ygrp-mlmsg * {line-height:1.22em;}#yiv8992618081 #yiv8992618081ygrp-mlmsg #yiv8992618081logo {padding-bottom:10px;}#yiv8992618081 #yiv8992618081ygrp-msg p a {font-family:Verdana;}#yiv8992618081 #yiv8992618081ygrp-msg p#yiv8992618081attach-count span {color:#1E66AE;font-weight:700;}#yiv8992618081 #yiv8992618081ygrp-reco #yiv8992618081reco-head {color:#ff7900;font-weight:700;}#yiv8992618081 #yiv8992618081ygrp-reco {margin-bottom:20px;padding:0px;}#yiv8992618081 #yiv8992618081ygrp-sponsor #yiv8992618081ov li a {font-size:130%;text-decoration:none;}#yiv8992618081 #yiv8992618081ygrp-sponsor #yiv8992618081ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv8992618081 #yiv8992618081ygrp-sponsor #yiv8992618081ov ul {margin:0;padding:0 0 0 8px;}#yiv8992618081 #yiv8992618081ygrp-text {font-family:Georgia;}#yiv8992618081 #yiv8992618081ygrp-text p {margin:0 0 1em 0;}#yiv8992618081 #yiv8992618081ygrp-text tt {font-size:120%;}#yiv8992618081 #yiv8992618081ygrp-vital ul li:last-child {border-right:none !important;}#yiv8992618081