• yesman@lemmy.world
    link
    fedilink
    arrow-up
    16
    arrow-down
    14
    ·
    3 days ago

    If you want to save a *.webp file, just change the extension to *.png. There is no need for a converter.

    • mke@lemmy.world
      link
      fedilink
      English
      arrow-up
      13
      arrow-down
      2
      ·
      edit-2
      3 days ago

      Sorry, is this comment meant in jest? If not, could you explain what exactly you mean by “no need for a converter?”

      I’m pretty sure that’s not how it works. No actual file data conversion is happening when you do that unless you’re using additional tools e.g. browser extensions.

      • Pirasp@lemmy.world
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        3 days ago

        Iirc .webp supports a fallback to PNG compression, so this actually works with some.webp files. I could be completely wrong tho.

        • mke@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          ·
          edit-2
          3 days ago

          Hey, thanks for the input. I’d like to read more about this, but I can’t seem to find anything related online. Anything else you could share?

          Just checking, you sure you’re not confusing fallback-to-another-format when the browser doesn’t support webp? Because that’s a bit of separate issue, and not a terribly relevant one since all major browsers have supported webp for a while now.

          • Poppa_Mo@lemmy.world
            cake
            link
            fedilink
            arrow-up
            1
            arrow-down
            8
            ·
            3 days ago

            You could’ve tried it yourself in the time it took you to craft this reply.

            It has nothing to do with the browser. Change extension or just save originally as .png instead of .webp

            Can pop the file right open in any image editor that can fart with pngs, post directly anywhere else, like Discord.

            • Victor@lemmy.world
              link
              fedilink
              arrow-up
              9
              ·
              3 days ago

              You could’ve tried it yourself in the time it took you to craft this reply.

              God I hate it when people have no social skills and talk like this.

              How the f— do you know the circumstances of the person you’re talking to? Maybe they don’t have a computer at hand.

              Don’t you realize how snotty and bratty and annoying this sounds, regardless?

              Bah.

            • mke@lemmy.world
              link
              fedilink
              English
              arrow-up
              5
              ·
              edit-2
              2 days ago

              I think I know what you’re talking about, and I think you might have misunderstood a few things. I’ll explain my point and I’d appreciate it if you could confirm later whether it helped, or if I’m the one who misunderstood you.

              “Saving as…” is, usually, just for setting the name of the file. The full filename, extension included. The extension is just another part of the name. It doesn’t define what rules the file’s contents actually follow. They’re for other purposes, such as helping your operating system know which software to use when opening each file. For example:

              User double clicks a .pdf System: Oh, I should try opening this in Adobe Acrobat.

              But that doesn’t mean the file is actually a PDF. You can change the extension of any file, and it won’t automatically be converted to that extension (unless a specific feature has been added to make that implicit conversion). You could give an executable a .pdf extension and your system might then try opening it in Acrobat. Of course, it won’t work—there’s no way the system could have automatically made that conversion for you.

              So you might wonder, why does your (fake) PNG—which is really just a webp with an incorrect extension—still work just fine? You can open it, view it, send it. What’s the trick?

              Thing is, the software that actually deals with those files doesn’t even need to care about the extension, it’s a lot smarter than that. These programs will use things like magic bytes to figure out what the file they’re handling really is and deal with it appropriately.

              So in this scenario, the user could save a webp file as PNG.

              funny cat.png (still a webp!)

              Then they might double click to open it.

              System: How do I open a .png again?

              • .webp -> try the image viewer
              • .jpeg -> try the image viewer
              • .png -> try the image viewer (there it is)

              And finally, the image viewer would correctly identify it as a webp image and display it normally.

              Image viewer: reading magic bytes… Image viewer: yeah, that’s a webp alright

              The user might then assume that, since everything works as expected, they properly converted their webp to a PNG. In reality, it’s all thanks to these programs, built upon decades of helping users just make things work. Same with Discord, Paint.NET, etc. Any decent software will handle files it’s meant to handle, even if they aren’t properly labeled.

              If you were to check the file contents though, using a tool like file, czkawka to find incorrect extensions, or even just checking image properties, it should still be identified as a webp.

              I didn’t try it myself as you said because, to my understanding of files and software, doing so made no sense. But again, do tell if I got something wrong or misinterpreted your comment.

    • corus_kt@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      3 days ago

      Note: this DOES NOT convert the file (obviously) although it will force it to be ‘usable’ in certain cases. If you bring the same file to a program that cannot work with webp format (ex. Da Vinci Resolve), it will crash or not show. To non-creators this is not an issue, but for creators: have fun figuring out which images you’ve saved are actually webp and won’t work later on.

      I know webp has become much less annoying after windows finally added webp support to photos after w11, so ‘advice’ like this tends to work more often than not. Just use a browser extension and convert it properly if you intend to spread an image…

      • Victor@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        3 days ago

        have fun figuring out which images you’ve saved are actually webp

        file * | grep -i webp or something?

    • AntiGuide@feddit.org
      link
      fedilink
      Deutsch
      arrow-up
      2
      ·
      3 days ago

      Are you sure? Maybe your image viewer adapts to the magic number and recognizes the webp file as webp anyway. I believe the formats are fundamentally different.