<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Convert Platform on Medium]]></title>
        <description><![CDATA[Stories by Convert Platform on Medium]]></description>
        <link>https://medium.com/@convert.app?source=rss-eb5593f9af67------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tLYam8joYQG6XiRHs6kPxw.png</url>
            <title>Stories by Convert Platform on Medium</title>
            <link>https://medium.com/@convert.app?source=rss-eb5593f9af67------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 00:24:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@convert.app/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Convert AVIF to PNG in various programming languages]]></title>
            <link>https://medium.com/@convert.app/convert-avif-to-png-in-various-programming-languages-f30f622e4fca?source=rss-eb5593f9af67------2</link>
            <guid isPermaLink="false">https://medium.com/p/f30f622e4fca</guid>
            <category><![CDATA[avif-to-png]]></category>
            <category><![CDATA[convert]]></category>
            <category><![CDATA[png]]></category>
            <category><![CDATA[avif]]></category>
            <dc:creator><![CDATA[Convert Platform]]></dc:creator>
            <pubDate>Thu, 08 Jan 2026 13:24:39 GMT</pubDate>
            <atom:updated>2026-01-11T12:43:55.985Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>Here are practical ways to convert <strong>AVIF to PNG</strong> in <strong>various programming languages and environments</strong>, including Nlibraries, tools, and sample approaches:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_n_0urEG7CvhB-8uP2Nug.png" /><figcaption>Avif To Png</figcaption></figure><h3>1. Command-Line / Tool-Based Conversion (All Languages)</h3><p>You can use universal tools from the command line and integrate them into scripts regardless of programming language:</p><p><strong>ImageMagick (CLI / scripting / bindings)</strong></p><ul><li>Convert a single file:</li><li>magick input.avif output.png</li><li>Bulk conversion (Linux/macOS):</li><li>for f in *.avif; do magick &quot;$f&quot; &quot;${f%.avif}.png&quot;; done</li></ul><p>ImageMagick supports many languages via bindings (C/C++, Java, .NET, Perl, PHP, Python, etc.) because it has APIs like <strong>MagickWand / MagickCore / PerlMagick / JMagick / MagickNet</strong>.</p><p><strong>FFmpeg (CLI / scripts)</strong></p><ul><li>Simple conversion:</li><li>ffmpeg -i input.avif output.png</li></ul><p>Useful in automation/batch scripts across platforms.</p><p><strong>libavif / libheif CLI</strong></p><ul><li>Use <strong>avifdec</strong> (from libavif) to decode to PNG:</li><li>avifdec input.avif output.png</li></ul><p>These tools are part of native AVIF libraries that you can call from build systems or makefiles.</p><h3>2. Python</h3><h3>Pillow + pillow-avif-plugin (simplest)</h3><p>Install:</p><pre>pip install Pillow pillow-avif-plugin</pre><p>Conversion code:</p><pre>from PIL import Image<br>import pillow_avif  # enables AVIF support</pre><pre>img = Image.open(&quot;input.avif&quot;)<br>img.save(&quot;output.png&quot;)</pre><p>This uses <strong>Pillow</strong> image API with AVIF plugin support.</p><h3>Alternative: Aspose.Imaging (more features)</h3><pre>pip install aspose-imaging-python-net</pre><p>This library permits advanced options, including PNG conversion control (compression, metadata).</p><h3>3. JavaScript / Node.js</h3><h3>Sharp (fast native image processing)</h3><p>Install:</p><pre>npm install sharp</pre><p>Convert AVIF to PNG:</p><pre>import sharp from &quot;sharp&quot;;</pre><pre>await sharp(&quot;input.avif&quot;)<br>  .png()<br>  .toFile(&quot;output.png&quot;);</pre><p><strong>sharp</strong> uses libvips under the hood and supports AVIF decoding/PNG encoding.</p><h3>Browser-Side Conversion (Web UI)</h3><p>You can handle a file upload and convert client-side using browser APIs and canvas, or simpler with &lt;input type=&quot;file&quot;&gt; and createImageBitmap. Libraries like <strong>browser-image-compression</strong> help manage formats.</p><h3>4. C / C++</h3><h3>Using libavif</h3><ul><li>Official AVIF library with encoding/decoding APIs.</li><li>Example workflow:</li></ul><ol><li>Load AVIF with libavif decode API.</li><li>Write raw pixel data to PNG with <strong>libpng</strong> or another PNG library.</li></ol><p>CLI tools from libavif:</p><pre>avifdec input.avif output.png</pre><p>(This uses built-in example tool.)</p><h3>Using libheif</h3><ul><li>libheif can decode AVIF / HEIF and output PNG via its sample tool heif-dec.</li></ul><p>Code example in C++ would wrap libavif/libheif decode and PNG writing (libpng).</p><h3>5. PHP</h3><h3>GD / Imagick extensions</h3><ul><li><strong>PHP GD</strong> supports AVIF starting with PHP 8.1 (AVIF read/write).</li></ul><pre>$img = imagecreatefromavif(&quot;input.avif&quot;);  // GD function<br>imagepng($img, &quot;output.png&quot;);<br>imagedestroy($img);</pre><h3>Imagick (ImageMagick binding)</h3><pre>$imagick = new Imagick(&quot;input.avif&quot;);<br>$imagick-&gt;setImageFormat(&quot;png&quot;);<br>$imagick-&gt;writeImage(&quot;output.png&quot;);</pre><h3>6. Java</h3><p>You can use bindings to ImageMagick or call a native tool:</p><h3>JMagick (ImageMagick Java API)</h3><pre>ImageInfo info = new ImageInfo(&quot;input.avif&quot;);<br>MagickImage image = new MagickImage(info);<br>image.setFileName(&quot;output.png&quot;);<br>image.writeImage(info);</pre><h3>JNI / Process Execution</h3><ul><li>Execute ImageMagick/FFmpeg from Java via ProcessBuilder.</li></ul><h3>7. .NET (C#, F#)</h3><h3>Magick.NET (ImageMagick wrapper)</h3><pre>using ImageMagick;</pre><pre>using (var img = new MagickImage(&quot;input.avif&quot;))<br>{<br>    img.Format = MagickFormat.Png;<br>    img.Write(&quot;output.png&quot;);<br>}</pre><h3>System.Drawing / GDIPLUS</h3><p>Not recommended for AVIF directly; use Magick.NET or call native tool.</p><h3>8. Go</h3><p>You can use native libraries or call external tools:</p><ul><li>Wrap <strong>libavif</strong> via cgo.</li><li>Or execute ffmpeg/magick from Go via os/exec.</li><li>Example with os/exec:</li></ul><pre>cmd := exec.Command(&quot;magick&quot;, &quot;input.avif&quot;, &quot;output.png&quot;)<br>cmd.Run()</pre><h3>9. Ruby</h3><h3>MiniMagick (ImageMagick wrapper)</h3><pre>require &quot;mini_magick&quot;</pre><pre>image = MiniMagick::Image.open(&quot;input.avif&quot;)<br>image.format &quot;png&quot;<br>image.write &quot;output.png&quot;</pre><h3>Summary of Options</h3><p>Approach Language Notes ImageMagick CLI / APIAnyUniversal, supports many bindings FFmpeg CLIAnyFlexible multimedia frameworkPillow + pillow-avif-pluginPythonSimple codeSharpNode.js/JSHigh-performance nativelibavif / libheifC/C++Low-level controlGD / ImagickPHPNative PHP conversionMagick.NET.NETManaged ImageMagick wrapperMiniMagickRubyRuby wrapper for ImageMagick</p><h3>Quick Web Conversion (no code)</h3><p>If you need a tool without programming:</p><ul><li>Use <a href="https://convert.app/file/avif-to-png/"><strong>Convert.APP AVIF to PNG</strong></a>, <strong>CloudConvert</strong>, <strong>Cloudinary</strong>, or <strong>CoolUtils</strong> online converters for quick <em>AVIF → PNG</em> conversion.</li></ul><p>If you want, I can provide <strong>code templates for specific languages</strong> (e.g., full runnable scripts) tailored to your tech stack.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f30f622e4fca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hex to ASCII Converter in C++]]></title>
            <link>https://medium.com/@convert.app/hex-to-ascii-converter-in-c-38ace601f94c?source=rss-eb5593f9af67------2</link>
            <guid isPermaLink="false">https://medium.com/p/38ace601f94c</guid>
            <category><![CDATA[hex]]></category>
            <category><![CDATA[ascii]]></category>
            <category><![CDATA[hexadecimal]]></category>
            <category><![CDATA[converter]]></category>
            <category><![CDATA[c]]></category>
            <dc:creator><![CDATA[Convert Platform]]></dc:creator>
            <pubDate>Sun, 23 Feb 2025 15:52:18 GMT</pubDate>
            <atom:updated>2025-02-23T15:52:18.305Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hex to ASCII Converter in C++ Coding</h3><p>Hexadecimal (Hex) and ASCII (American Standard Code for Information Interchange) are widely used in computing. Hex is a base-16 number system, while ASCII is a character encoding standard that maps characters to numerical values. Converting hexadecimal to ASCII is useful in data encoding, debugging, and cryptography.</p><p>In this article, we will explore how to create a <strong>Hex to ASCII Converter</strong> using C++.</p><h3>Understanding Hex to ASCII Conversion</h3><p>Hexadecimal numbers use digits from 0-9 and letters from A-F, where each hex pair represents a single ASCII character. For example:</p><p>Hex ASCII 41 A 42 B 43 C 61 a 62 b 63 c</p><h3>Conversion Process</h3><ol><li>Split the hex string into pairs of two characters.</li><li>Convert each pair from hex to a decimal integer.</li><li>Convert the decimal integer to its ASCII character.</li><li>Combine the ASCII characters to form a readable string.</li></ol><h3>Implementing in C++</h3><p>Let’s write a C++ program to convert a hexadecimal string to ASCII.</p><h3>Step 1: Setting Up the Project</h3><p>Create a new C++ file, e.g., hex_to_ascii.cpp.</p><h3>Step 2: Writing the Conversion Function</h3><p>Below is the implementation:</p><pre>#include &lt;iostream&gt;<br>#include &lt;sstream&gt;<br>#include &lt;iomanip&gt;<br>#include &lt;string&gt;</pre><pre>std::string hexToAscii(const std::string&amp; hex) {<br>    std::string ascii;<br>    if (hex.length() % 2 != 0) {<br>        return &quot;Invalid hex string length&quot;;<br>    }<br>    for (size_t i = 0; i &lt; hex.length(); i += 2) {<br>        std::string byteStr = hex.substr(i, 2);<br>        char ch = static_cast&lt;char&gt;(std::stoi(byteStr, nullptr, 16));<br>        ascii += ch;<br>    }<br>    return ascii;<br>}</pre><pre>int main() {<br>    std::string hexInput;<br>    std::cout &lt;&lt; &quot;Enter a hexadecimal string: &quot;;<br>    std::cin &gt;&gt; hexInput;<br>    <br>    std::string asciiOutput = hexToAscii(hexInput);<br>    std::cout &lt;&lt; &quot;ASCII equivalent: &quot; &lt;&lt; asciiOutput &lt;&lt; std::endl;<br>    <br>    return 0;<br>}</pre><h3>Step 3: Compiling and Running the Program</h3><p>Compile the program using:</p><pre>g++ hex_to_ascii.cpp -o hex_to_ascii</pre><p>Run the program:</p><pre>./hex_to_ascii</pre><p>Enter a hexadecimal string like 48656C6C6F, and the output will be Hello.</p><p>Here demo link web based: <a href="https://convert.app/tool/hex-to-ascii/">https://convert.app/tool/hex-to-ascii/</a></p><h3>Explanation of Code</h3><ol><li>The hexToAscii function checks if the hex string length is even.</li><li>It extracts each two-character substring (hex pair) and converts it to an ASCII character.</li><li>The main function takes user input, calls hexToAscii, and prints the result.</li></ol><h3>Enhancements</h3><ul><li>Handle invalid characters in the hex string.</li><li>Add support for lowercase hex letters.</li><li>Develop a graphical or web-based interface for better usability.</li></ul><p>This article demonstrated how to create a <strong>Hex to ASCII Converter</strong> using C++. Understanding this conversion is useful in networking, cryptography, and data encoding. Rust’s type safety and performance make it a great choice for handling such conversions efficiently.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38ace601f94c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decimal to Binary Converter in Rust Language]]></title>
            <link>https://medium.com/@convert.app/decimal-to-binary-converter-in-rust-language-a5ba42904b71?source=rss-eb5593f9af67------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5ba42904b71</guid>
            <category><![CDATA[binary]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[converter]]></category>
            <category><![CDATA[decimal]]></category>
            <dc:creator><![CDATA[Convert Platform]]></dc:creator>
            <pubDate>Sun, 23 Feb 2025 15:47:49 GMT</pubDate>
            <atom:updated>2025-02-23T15:47:49.402Z</atom:updated>
            <content:encoded><![CDATA[<p>In computing, the binary (base-2) number system is fundamental, as it is the basis of all modern digital electronics and computing. Converting a decimal (base-10) number to binary is a common operation in programming and computer science. In this article, we will build a <strong>Decimal to Binary Converter</strong> using the Rust programming language.</p><h3>Why Rust?</h3><p>Rust is a systems programming language known for its safety, concurrency, and performance. It provides strong type safety and memory management without a garbage collector, making it an excellent choice for high-performance applications.</p><h3>Understanding Decimal to Binary Conversion</h3><p>The decimal to binary conversion is performed using the <strong>division-by-2</strong> method:</p><ol><li>Divide the decimal number by 2.</li><li>Store the remainder (0 or 1).</li><li>Repeat the process with the quotient until it becomes zero.</li><li>Read the stored remainders in reverse order to obtain the binary representation.</li></ol><p>For example, converting 13 to binary:</p><p>Step Decimal Quotient Remainder 1 13 6 1 2 6 3 0 3 3 1 1 4 1 0 1</p><p>Reading the remainders in reverse gives: 1101.</p><h3>Implementing in Rust</h3><p>Let’s write a Rust program that converts a decimal number to binary.</p><h3>Step 1: Setting Up the Rust Project</h3><p>Create a new Rust project:</p><pre>cargo new decimal_to_bin_converter<br>cd decimal_to_bin_converter</pre><h3>Step 2: Writing the Conversion Function</h3><p>Edit src/main.rs and add the following code:</p><pre>use std::io;</pre><pre>fn decimal_to_binary(mut decimal: u32) -&gt; String {<br>    let mut binary_string = String::new();<br>    if decimal == 0 {<br>        return &quot;0&quot;.to_string();<br>    }<br>    while decimal &gt; 0 {<br>        let remainder = decimal % 2;<br>        binary_string.insert(0, char::from_digit(remainder, 10).unwrap());<br>        decimal /= 2;<br>    }<br>    binary_string<br>}</pre><pre>fn main() {<br>    println!(&quot;Enter a decimal number:&quot;);<br>    let mut decimal_input = String::new();<br>    io::stdin().read_line(&amp;mut decimal_input).expect(&quot;Failed to read input&quot;);<br>    let decimal_input = decimal_input.trim().parse::&lt;u32&gt;();<br>    <br>    match decimal_input {<br>        Ok(decimal) =&gt; println!(&quot;Binary equivalent: {}&quot;, decimal_to_binary(decimal)),<br>        Err(_) =&gt; println!(&quot;Invalid decimal input.&quot;),<br>    }<br>}</pre><h3>Step 3: Running the Program</h3><p>Compile and run the program using:</p><pre>cargo run</pre><p>Enter a decimal number like 13, and the program will output its binary equivalent: 1101.</p><h3>Explanation of Code</h3><ol><li>The decimal_to_binary function repeatedly divides the decimal number by 2 and prepends the remainder to the result string.</li><li>If the input is 0, it directly returns &quot;0&quot;.</li><li>The main function reads user input, trims whitespace, parses it to an integer, and calls the conversion function.</li><li>The result is displayed to the user.</li></ol><h3>Finally</h3><p>This article demonstrated how to create a <strong>Decimal to Binary Converter</strong> using Rust. Code demo link: <a href="https://convert.app/tool/decimal-to-binary/">https://convert.app/tool/decimal-to-binary/</a></p><p>Rust’s type safety and performance make it a great choice for handling such conversions efficiently. You can extend this program by adding more features like handling signed integers, output formatting, or integrating it into a web-based tool.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5ba42904b71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hexadecimal to Binary Converter in Rust Lang]]></title>
            <link>https://medium.com/@convert.app/hexadecimal-to-binary-converter-in-rust-lang-53bc116e2f84?source=rss-eb5593f9af67------2</link>
            <guid isPermaLink="false">https://medium.com/p/53bc116e2f84</guid>
            <category><![CDATA[hexadecimal]]></category>
            <category><![CDATA[binary]]></category>
            <category><![CDATA[converter]]></category>
            <category><![CDATA[convert]]></category>
            <dc:creator><![CDATA[Convert Platform]]></dc:creator>
            <pubDate>Sun, 23 Feb 2025 15:42:51 GMT</pubDate>
            <atom:updated>2025-02-23T15:42:51.085Z</atom:updated>
            <content:encoded><![CDATA[<p>In computing, hexadecimal (base-16) and binary (base-2) number systems are widely used, especially in low-level programming, networking, and cryptography. Converting hexadecimal to binary is a common operation, as each hex digit corresponds to exactly four binary digits (bits). In this article, we will build a <strong>Hexadecimal to Binary Converter</strong> using the Rust programming language.</p><h3>Why Rust?</h3><p>Rust is a systems programming language known for its safety, concurrency, and performance. It provides strong type safety and memory management without a garbage collector, making it an excellent choice for high-performance applications.</p><h3>Understanding Hexadecimal to Binary Conversion</h3><p>Each hexadecimal digit represents four binary digits:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*qMqCEvp1zZtjQiqLN0zV2A.png" /></figure><p>Source: <a href="https://convert.app/tool/hex-to-binary/">https://convert.app/tool/hex-to-binary/</a></p><p>To convert a hexadecimal number to binary, we replace each hex digit with its equivalent binary representation.</p><h3>Implementing in Rust</h3><p>Let’s write a Rust program that converts a hexadecimal string to binary.</p><h3>Step 1: Setting Up the Rust Project</h3><p>Create a new Rust project:</p><pre>cargo new hex_to_bin_converter<br>cd hex_to_bin_converter</pre><h3>Step 2: Writing the Conversion Function</h3><p>Edit src/main.rs and add the following code:</p><pre>use std::io;</pre><pre>fn hex_to_binary(hex: &amp;str) -&gt; Option&lt;String&gt; {<br>    let mut binary_string = String::new();<br>    for c in hex.chars() {<br>        let binary = match c {<br>            &#39;0&#39; =&gt; &quot;0000&quot;,<br>            &#39;1&#39; =&gt; &quot;0001&quot;,<br>            &#39;2&#39; =&gt; &quot;0010&quot;,<br>            &#39;3&#39; =&gt; &quot;0011&quot;,<br>            &#39;4&#39; =&gt; &quot;0100&quot;,<br>            &#39;5&#39; =&gt; &quot;0101&quot;,<br>            &#39;6&#39; =&gt; &quot;0110&quot;,<br>            &#39;7&#39; =&gt; &quot;0111&quot;,<br>            &#39;8&#39; =&gt; &quot;1000&quot;,<br>            &#39;9&#39; =&gt; &quot;1001&quot;,<br>            &#39;A&#39; | &#39;a&#39; =&gt; &quot;1010&quot;,<br>            &#39;B&#39; | &#39;b&#39; =&gt; &quot;1011&quot;,<br>            &#39;C&#39; | &#39;c&#39; =&gt; &quot;1100&quot;,<br>            &#39;D&#39; | &#39;d&#39; =&gt; &quot;1101&quot;,<br>            &#39;E&#39; | &#39;e&#39; =&gt; &quot;1110&quot;,<br>            &#39;F&#39; | &#39;f&#39; =&gt; &quot;1111&quot;,<br>            _ =&gt; return None, // Invalid character<br>        };<br>        binary_string.push_str(binary);<br>    }<br>    Some(binary_string)<br>}</pre><pre>fn main() {<br>    println!(&quot;Enter a hexadecimal number:&quot;);<br>    let mut hex_input = String::new();<br>    io::stdin().read_line(&amp;mut hex_input).expect(&quot;Failed to read input&quot;);<br>    let hex_input = hex_input.trim();<br>    <br>    match hex_to_binary(hex_input) {<br>        Some(binary) =&gt; println!(&quot;Binary equivalent: {}&quot;, binary),<br>        None =&gt; println!(&quot;Invalid hexadecimal input.&quot;),<br>    }<br>}</pre><h3>Step 3: Running the Program</h3><p>Compile and run the program using:</p><pre>cargo run</pre><p>Enter a hexadecimal number like 1A3F, and the program will output its binary equivalent: 0001101000111111.</p><h3>Explanation of Code</h3><ol><li>The hex_to_binary function iterates through each character of the input string and converts it to a four-bit binary string.</li><li>It handles uppercase and lowercase hex digits.</li><li>If an invalid character is encountered, it returns None.</li><li>The main function reads user input, trims whitespace, and calls the conversion function.</li><li>The result is displayed to the user.</li></ol><h3>Final Notes</h3><p>This article demonstrated how to create a <strong>Hexadecimal to Binary Converter</strong> using Rust. Rust’s type safety and performance make it a great choice for handling such conversions efficiently. You can extend this program by adding more features like handling prefixes (0x), output formatting, or integrating it into a web-based tool.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53bc116e2f84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WebP to PNG: using **Perl]]></title>
            <link>https://medium.com/@convert.app/webp-to-png-using-perl-1982dc5ee138?source=rss-eb5593f9af67------2</link>
            <guid isPermaLink="false">https://medium.com/p/1982dc5ee138</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[webp]]></category>
            <category><![CDATA[convert]]></category>
            <category><![CDATA[png]]></category>
            <dc:creator><![CDATA[Convert Platform]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 14:00:24 GMT</pubDate>
            <atom:updated>2025-01-08T14:07:45.743Z</atom:updated>
            <content:encoded><![CDATA[<h3>WebP to PNG: using Perl</h3><p>Converting <a href="https://convert.app/file/webp-to-png/"><strong>WebP to PNG</strong></a> using <strong>Perl</strong> involves leveraging image processing libraries and tools that Perl can interface with. Below is a detailed guide on how to achieve this:</p><h3>1. Prerequisites</h3><p>Before starting, ensure you have the following installed:</p><ul><li><strong>Perl</strong>: Installed on your system.</li><li><strong>ImageMagick</strong>: A powerful tool for image manipulation. Perl can use it via the Image::Magick module.</li><li><strong>Perl Modules</strong>:</li><li>Image::Magick: Perl interface to ImageMagick.</li><li>File::Copy: For handling file operations.</li></ul><p>Install the required Perl module using CPAN:</p><pre>cpan install Image::Magick</pre><h3>2. Steps to Convert WebP to PNG</h3><ol><li><strong>Read the WebP Image</strong>:</li></ol><ul><li>Use Image::Magick to load the WebP image.</li></ul><ol><li><strong>Convert to PNG</strong>:</li></ol><ul><li>Use the Write method to save the image in PNG format.</li></ul><ol><li><strong>Save the Output</strong>:</li></ol><ul><li>Save the converted PNG image to the desired location.</li></ul><h3>3. Example Code</h3><p>Here’s a complete Perl script to convert a WebP image to PNG:</p><pre>#!/usr/bin/perl<br>use strict;<br>use warnings;<br>use Image::Magick;<br>use File::Copy;</pre><pre># Input and output file paths<br>my $webp_file = &#39;input.webp&#39;;<br>my $png_file  = &#39;output.png&#39;;</pre><pre># Create a new Image::Magick object<br>my $image = Image::Magick-&gt;new;</pre><pre># Read the WebP image<br>my $status = $image-&gt;Read($webp_file);<br>die &quot;Error reading $webp_file: $status&quot; if $status;</pre><pre># Convert and write the image as PNG<br>$status = $image-&gt;Write($png_file);<br>die &quot;Error writing $png_file: $status&quot; if $status;</pre><pre>print &quot;Conversion successful: $webp_file -&gt; $png_file\n&quot;;</pre><h3>4. Explanation of the Code</h3><ul><li><strong>Image::Magick-&gt;new</strong>: Creates a new image object.</li><li>image−&gt;Read(<em>image</em>−&gt;<em>Read</em>(<strong>webp_file)</strong>: Reads the WebP image into the object.</li><li>image−&gt;Write(<em>image</em>−&gt;<em>Write</em>(<strong>png_file)</strong>: Writes the image in PNG format.</li><li><strong>Error Handling</strong>: The script checks for errors during reading and writing.</li></ul><h3>5. Running the Script</h3><ol><li>Save the script as webp_to_png.pl.</li><li>Make the script executable:</li></ol><ul><li>chmod +x webp_to_png.pl</li></ul><ol><li>Run the script: bash</li></ol><ul><li>./webp_to_png.pl</li></ul><h3>6. Additional Features</h3><p>You can extend the script to include the following features:</p><h4>a. Batch Conversion</h4><p>Convert multiple WebP files in a directory:</p><pre>#!/usr/bin/perl<br>use strict;<br>use warnings;<br>use Image::Magick;<br>use File::Basename;</pre><pre>my $input_dir  = &#39;webp_images&#39;;<br>my $output_dir = &#39;png_images&#39;;</pre><pre># Create output directory if it doesn&#39;t exist<br>mkdir $output_dir unless -d $output_dir;</pre><pre># Process all WebP files in the input directory<br>opendir(my $dh, $input_dir) or die &quot;Cannot open directory: $!&quot;;<br>while (my $file = readdir($dh)) {<br>    next unless $file =~ /\.webp$/i; # Only process WebP files</pre><pre>    my $webp_file = &quot;$input_dir/$file&quot;;<br>    my $png_file  = &quot;$output_dir/&quot; . basename($file, &#39;.webp&#39;) . &#39;.png&#39;;</pre><pre>    my $image = Image::Magick-&gt;new;<br>    my $status = $image-&gt;Read($webp_file);<br>    warn &quot;Error reading $webp_file: $status&quot; and next if $status;</pre><pre>    $status = $image-&gt;Write($png_file);<br>    warn &quot;Error writing $png_file: $status&quot; and next if $status;</pre><pre>    print &quot;Converted: $webp_file -&gt; $png_file\n&quot;;<br>}<br>closedir($dh);</pre><h4>b. Resize During Conversion</h4><p>Resize the image while converting:</p><pre>$image-&gt;Resize(width =&gt; 800, height =&gt; 600); # Resize to 800x600<br>$image-&gt;Write($png_file);</pre><h4>c. Quality Adjustment</h4><p>Adjust the PNG compression quality:</p><pre>$image-&gt;Set(quality =&gt; 90); # Set quality to 90%<br>$image-&gt;Write($png_file);</pre><h3>7. Dependencies</h3><ul><li><strong>ImageMagick</strong>: Ensure it supports WebP format. You can check using:</li><li>bash</li><li>convert -list format | grep -i webp</li><li>If WebP is not listed, reinstall ImageMagick with WebP support.</li></ul><h3>8. Alternative Libraries</h3><p>If you prefer not to use ImageMagick, you can use other Perl modules:</p><ul><li><strong>Imager</strong>: A pure Perl image manipulation library.</li><li><strong>GD</strong>: Another image processing library.</li></ul><p>Example with <strong>Imager</strong>:</p><p>perl</p><p>Copy</p><pre>use Imager;<br>my $image = Imager-&gt;new(file =&gt; &#39;input.webp&#39;);<br>$image-&gt;write(file =&gt; &#39;output.png&#39;) or die $image-&gt;errstr;</pre><p>Using Perl and ImageMagick, you can easily convert WebP images to PNG. The script is flexible and can be extended for batch processing, resizing, and quality adjustments. If you need a lightweight solution, consider using <strong>Imager</strong> or <strong>GD</strong> instead of ImageMagick.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1982dc5ee138" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Date Calculator Web App with JavaScript and HTML]]></title>
            <link>https://medium.com/@convert.app/date-calculator-web-app-with-javascript-and-html-b82998041a37?source=rss-eb5593f9af67------2</link>
            <guid isPermaLink="false">https://medium.com/p/b82998041a37</guid>
            <category><![CDATA[datetime]]></category>
            <category><![CDATA[date]]></category>
            <category><![CDATA[time-calculator]]></category>
            <category><![CDATA[date-calculator]]></category>
            <category><![CDATA[calculator]]></category>
            <dc:creator><![CDATA[Convert Platform]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 13:45:06 GMT</pubDate>
            <atom:updated>2025-01-08T13:11:11.400Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Date calculator web app" src="https://cdn-images-1.medium.com/max/1024/1*znUOdVOK7hUyZoh6zTBoTA.png" /></figure><p><strong>In this tutorial, we will explore how to create a date calculator web application using JavaScript and HTML like as </strong><a href="https://calculator.date/"><strong><em>Calculator.Date</em></strong></a><strong><em>.</em>. Date calculators are handy tools that allow users to calculate the difference between two dates, a common task in various domains such as finance, project management, and scheduling.</strong> By the end of this tutorial, you’ll have a functional web application that enables users to input two dates and calculates the difference between them in days.</p><p><a href="https://calculator.bot/calc.png?source=user_about----------------------eb5593f9af67---------------">https://calculator.bot/calc.png</a></p><p>dd</p><p><a href="https://calculator.bot/date/">Date Calculator</a></p><h4>Prerequisites: To follow along with this tutorial, you should have a basic understanding of HTML, CSS, and JavaScript. Additionally, you’ll need a text editor and a web browser.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*Me6ok0N5gWzJgT7Ldk-nCA.png" /></figure><p><strong>Step 1: </strong>Setting Up the HTML Structure: We’ll start by creating the basic structure of our web application using HTML. Open your text editor and create a new file named index.html. In this file, we&#39;ll define the layout of our date calculator app.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Date Calculator&lt;/title&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;styles.css&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;div class=&quot;container&quot;&gt;<br>        &lt;h1&gt;Date Calculator&lt;/h1&gt;<br>        &lt;!-- Input fields for start and end dates --&gt;<br>        &lt;label for=&quot;startDate&quot;&gt;Start Date:&lt;/label&gt;<br>        &lt;input type=&quot;date&quot; id=&quot;startDate&quot;&gt;<br>        &lt;br&gt;<br>        &lt;label for=&quot;endDate&quot;&gt;End Date:&lt;/label&gt;<br>        &lt;input type=&quot;date&quot; id=&quot;endDate&quot;&gt;<br>        &lt;br&gt;<br>        &lt;!-- Button to trigger calculation --&gt;<br>        &lt;button onclick=&quot;calculateDifference()&quot;&gt;Calculate Difference&lt;/button&gt;<br>        &lt;!-- Placeholder for displaying the result --&gt;<br>        &lt;div id=&quot;result&quot;&gt;&lt;/div&gt;<br>    &lt;/div&gt;<br>    &lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>Step 2:</strong> Styling the Application with CSS: Now that we have defined the structure of our HTML, let’s add some basic styling to make our application visually appealing. Create a new file named styles.css in the same directory as index.html and add the following styles:</p><pre>body {<br>    font-family: Arial, sans-serif;<br>    text-align: center;<br>}<br>.container {<br>    margin-top: 50px;<br>}<br>label {<br>    font-weight: bold;<br>}<br>input[type=&quot;date&quot;] {<br>    margin: 10px;<br>    padding: 5px;<br>}<br>button {<br>    margin-top: 20px;<br>    padding: 10px 20px;<br>    font-size: 16px;<br>    cursor: pointer;<br>}<br>#result {<br>    margin-top: 20px;<br>}</pre><p><strong>Step 3:</strong> Implementing the Date Calculation Logic in JavaScript: The core functionality of our date calculator will be implemented using JavaScript. Create a new file named script.js in the same directory as index.html and add the following JavaScript code:</p><pre>function calculateDifference() {<br>    // Get the values of start and end dates<br>    const startDateInput = document.getElementById(&#39;startDate&#39;).value;<br>    const endDateInput = document.getElementById(&#39;endDate&#39;).value;<br>// Convert input strings to Date objects<br>    const startDate = new Date(startDateInput);<br>    const endDate = new Date(endDateInput);<br>    // Calculate the difference in milliseconds<br>    const difference = Math.abs(startDate - endDate);<br>    // Convert milliseconds to days<br>    const differenceInDays = Math.ceil(difference / (1000 * 60 * 60 * 24));<br>    // Display the result<br>    const resultElement = document.getElementById(&#39;result&#39;);<br>    resultElement.innerHTML = `The difference between ${startDate.toDateString()} and ${endDate.toDateString()} is ${differenceInDays} days.`;<br>}</pre><pre><strong> Step 4: Running the Application:</strong> To run the date calculator application, simply open the index.html file in a web browser. You should see the input fields for the start and end dates, a button to trigger the calculation, and a placeholder for displaying the result. Enter the desired dates and click the &quot;Calculate Difference&quot; button to see the result.</pre><p><a href="https://date.calculator.bot/">Date Calculator</a></p><h3>Final notes:</h3><p>In this tutorial, we learned how to build a simple date calculator web application using JavaScript and HTML. We started by creating the HTML structure, added some basic styling with CSS, implemented the date calculation logic using JavaScript, and finally ran the application in a web browser. You can further enhance this application by adding features such as error handling, support for different date formats, and more sophisticated date manipulation functionalities. Feel free to explore and customize the code to suit your specific requirements. Happy coding!</p><p>Dont forget write me comment ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b82998041a37" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>