Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Upcoming Changes to PNG Support at Twitter (twittercommunity.com)
62 points by polm23 on Dec 27, 2018 | hide | past | favorite | 43 comments


Semi-relevant thread about tricking this upload/convert system to keep images in PNG: https://twitter.com/FioraAeterna/status/1077786781133631489


Tumblr was the last platform that actually respected my creative choices for compression of my work and gave me full control over how my work was presented.

Now people are acting as if Tumblr is over and yet again the so called solution is to move your work to Instagram or Twitter.

Why is the “solution” always to move to platforms with little to no respect for your actual work there. I’m tired of stressing over how an image/video looks only to upload it to social media and have it covered in a JPEG Vaseline smear.

This is before I bring up how far these networks also go in trying to keep me from just dragging content out of their site and to my desktop


Abstract previews that link to full HD content on a platform you control?


This is a very sensible suggestion but I have tried this before with nice gif previews linking to Vimeo and although the gif gets good engagement almost no one clicks though

In reality the first impression is all you ever get on social media.


This announcement makes sense to me, having done something similar before personally (1). The difference between a screenshot of a photo saved as a PNG and a JPG is huge, usually over 1MB, and I'm sure Twitter gets plenty of these.

Publishing their thresholds for the JPG vs PNG size comparison instead of referring to it just an internal metric would clear up some disconnect. Plus, I'd love to improve the static values I chose if there is better data available. I doubt the people working on this project wanted to change any PNG unless it's clear cut but the line has to go somewhere. These will be better handled by JPG.

Numbers about avg file size would be awesome too, how much data will this save in a typical user session?

1 - https://engineeringblog.yelp.com/2017/06/making-photos-small... (Section: Large PNG Detection)


The truth is, they already do convert almost every screenshot to JPEG. The only criteria I'm aware of that Twitter ever used to keep something as PNG was if it had any pixels that were not fully opaque.


Can we talk about the awful video compression on Twitter and how the only workaround to Twitter shitting on your video is to submit it as a perfectly crafted gif which takes dozens of trial and error iterations to produce?

It's 2019. Every other media sharing site on the planet is friendlier to preserving video quality than Twitter is. For a platform which carries so much programming\technical content, having video compression set to 'DESTROY ANY KIND OF PIXEL LEVEL DETAIL' is super painful. I can't be the only user that stopped uploading video content because of the effort involved in hand-crafting Twitter gifs.

Everything that can be achieved with these specially produced gifs could also be achieved by simply upping video quality for small videos. Plus removing the insanity of creating such content. Plus actually saving bandwidth since gifs are super wasteful.

There's a whole category of articles about how to 'trick' Twitter into preserving the quality of your image or video upload. That's insane. Define and publish some compression specs at which you won't destroy the content.


The funniest and most depressing part of all this is that twitter 'gifs' are mp4s


What video compression they use inside mp4 container?


Picked a "gif" at random:

  Format                                   : MPEG-4
  Format profile                           : Base Media / Version 2
  Codec ID                                 : mp42
  File size                                : 1.61 MiB
  Duration                                 : 4s 890ms
  Overall bit rate                         : 2 766 Kbps
  Encoded date                             : UTC 2018-06-07 09:34:57
  Tagged date                              : UTC 2018-06-07 09:34:57

  Video
  ID                                       : 1
  Format                                   : AVC
  Format/Info                              : Advanced Video Codec
  Format profile                           : Baseline@L3.0
  Format settings, CABAC                   : No
  Format settings, ReFrames                : 1 frame
  Codec ID                                 : avc1
  Codec ID/Info                            : Advanced Video Coding
  Duration                                 : 4s 890ms
  Bit rate                                 : 2 764 Kbps
  Width                                    : 720 pixels
  Height                                   : 414 pixels
  Display aspect ratio                     : 1.739
  Frame rate mode                          : Variable
  Frame rate                               : 33.538 fps
  Original frame rate                      : 1 000.000 fps
  Minimum frame rate                       : 33.333 fps
  Maximum frame rate                       : 1 000.000 fps
  Color space                              : YUV
  Chroma subsampling                       : 4:2:0
  Bit depth                                : 8 bits
  Scan type                                : Progressive
  Bits/(Pixel*Frame)                       : 0.276
  Stream size                              : 1.61 MiB (100%)
  Title                                    : Twitter v1.0-757770b7c8e9d79a526cdff77e74666386274fdf
  Writing library                          : x264 core 148
  Encoding settings                        : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=1 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=2:1.00
  Encoded date                             : UTC 2018-06-07 09:34:57
  Tagged date                              : UTC 2018-06-07 09:34:57


The videos look pretty bad when uploaded to Twitter from a Switch (e.g., https://mobile.twitter.com/crotchmedia/status/10754735897831...). So this is Twitter’s fault, huh?


I just wish they’d up the file size and length maximums. Kind of amazed they don’t as I know quite a few outlets that don’t like using YouTube and would gladly host it on twitter. It’d also help keep people on twitter longer = more ads.


Sorry, but how is it possible to create "perfectly created gif" to replace the video you're uploading? IIRC, the largest gifs Twitter seems to support is 15MB. You're having problems with seconds of video?


Yes, seconds of video. That's the price you have to pay on Twitter to not have your content turned into a blob of smudge.

15mb is the total bucket size you need to fill. How you fill that bucket depends on:

Length

Palette

Dithering settings

The actual amount of pixels changed in the segment of video you're showing

You then embark on a journey to take your original 10 second video segment and produce the ideal 15mb gif by tweaking all of the above.

Or you just upload the whole 10 second video to imgur and get back an 8mb pixel perfect mp4.

https://twitter.com/DeusVerus/status/1004657962663596032

https://twitter.com/spetulla/status/1072604230681329665

https://twitter.com/mbostock/status/1064241248049881088

https://twitter.com/veltman/status/1068226765632327680

All of these posts are hand-crafted gifs designed to work around Twitter's video compression.


This will start making screenshots uploaded to their service lossy, with compression, which is unfortunate.


Not necessarily, depends on what it’s a screenshot of. If it’s of a web page or application, odds are that it will have large sections of uniform color (white backgrounds for instance). This is compressed very well in PNG, which uses DEFLATE/LZ77.

So it’s pretty likely that the PNG will be smaller than the converted JPEG in many cases. Screenshots of videos, photos, however will likely be converted.


Images from pngquant[1] will be left unscathed, so use it if you want to preserve transparency and sharpness.

The PNG-8 variant is 3-4 times smaller than a truecolor PNG, which is why Twitter is allowing it.

[1]: https://pngquant.org/


It looks like pngquant can change palette subtly, but for e.g. pixel art or art with carefully selected palettes what are the downsides?


Pixel art is likely to have only a few dominant colors, so it should convert losslessly or nearly so.

Most other quantization implementations unconditionally drop a few least significant bits of colors, giving images a posterized look of a 16-bit console. pngquant tries very hard not to do that, as its goal is to have no visible loss, just smaller files.


I am not sure how to interpret the article. Does it mean there will be a way to upload an 8-Bit PNG image as a header image and Twitter will store and display it unmodified?

That would be a great step forward. Currently, the compressed header images look really bad.


“image load performance needed at a global scale“

Looks like supporting high quality png can be added to our list of creative things founders do to bootstrap their businesses that don’t scale. But converting millions of existing pieces of content from transparent to white background is surely a loss for the people. Not as bad as when Microsoft rolled back everyone’s onedrive storage though.


> These changes will be applied to all images uploaded to Twitter from February 11th and forward, regardless of the category the image is for.

Looks like they only do the conversion for newly uploaded images beginning Feburary 11th.


Ah rats. Reading comprehension fail. Thx. I guess the change is not really so much to complain about, though I suppose it could be argued that they’re dropping product quality after cementing large market share.


The way Twitter and Instagram mangle and crap up images reminds me of how AOL used to download all images in a really awful format:

https://en.wikipedia.org/wiki/ART_image_file_format

The more things change!


If PNG-8 will be "preserved unmodified", then APNG in PNG-8 like this one will probably work: https://tinypng.com/images/apng/panda-waving.png


So in other words they're closing the loophole where you can force lossless by adding a single transparent pixel.

This is almost definitely good for Twitter's bottom line, but no doubt it is bad for a growing segment of their userbase: artists. People have been flocking to Twitter from sites like deviantArt, Tumblr, etc. to escape drama, harassment, policy changes, etc. for years now. The latest round of them come from Tumblr's explicit content purge.

Now, I actually don't use Twitter. But the news of this change spread so quickly that I already heard about it last night. So to say that this is a problem is an understatement. I'm currently recommending to people to just upload their work elsewhere and make use of Twitter's decent embedding functionality. (Pixiv is a great site to post drawings, for example, and it embeds decently on Twitter.)

(On the other hand, I do like that smaller PNGs win against JPEG - I am fairly sure in the past, transparency was one of the only criteria that kept you as PNG.)


Twitter is one of the worst sites to post artwork on. Not due to compression, but the complete lack of features a dedicated art gallery normally has. Tagging and searchability are bad. Artists don't usually make separate accounts for art and blogs/memes so good luck filtering it. No one's going to see your old content.

I can't remember pixiv's rules specifically, isn't it based in japan? The black line censorship thing isn't going to fly with anyone who left tumblr because they banned NSFW.


It has flied with plenty of artists actually, many of them I personally know have taken the compromise long before Tumblr officially banned pornographic content. In addition, Pixiv doesn't moderate this super actively; it turns out if you stick uncensored variants outside page 1 you generally get a blind eye. Generally, people are a lot less afraid of having their entire accounts banned for rule violations, unlike American websites. (This case is particularly fascinating to me because said rule violation is quite literally breaking the law... but apparently they are still more lenient than Western websites tend to be about mundane issues.)

I'm not saying I disagree that Twitter is a terrible site for artists. But, artists want a social platform where they can both post freely and interact with non-artists or people in different forms of art. Pixiv and SoundCloud are both great websites, but it turns out A.) A lot of people dabble in both music production and drawing, and B.) A lot of the same people in both of these art forms interact with eachother. (This is especially apparent looking at indie games and gamejams!)

Fwiw, Twitter has been pretty mixed on NSFW content. They've turned a blind eye to most of it. Especially for Japanese-speaking users, presumably because Japanese advertisers don't have the same mentality as Western ones do. Still, I've heard of a few accounts being banned for vague reasons.

So yeah... Twitter is not great for art. But, artists want a general social platform to hang out in, and for many Twitter is currently serving that purpose for better or worse.


Is it too much to ask that Twitter serve the very same image I uploaded without subjecting my content to AOL-style "optimizations"?


Didn't know PNG supported palette mode. From a pure image quality standpoint, is there any difference between a palette PNG-8 and a still GIF?


The PNG supports translucent pixels, not just 100 or 0% transparency.


Yep. Photoshop's PNG library however does not, it's palleted PNG support doesn't handle Alpha for some reason.


Better compression and PNG allows for metadata.


No difference.


PNG is lossless, so the quality will be better.


so is GIF.


Oops. The dithering is what makes the gif’s look off, unless the original color is carefully chosen.

PNG’s do alpha better at least.


Not 8 bit PNGs. Those are more or less exactly like GIFs, dithering, palette transparency and all.


As far as I know they can have a transparency value for each palette entry, instead of just binary transparency.

https://en.wikipedia.org/wiki/Portable_Network_Graphics#Tran...

> For paletted images, alpha values can be added to palette entries. The number of such values stored may be less than the total number of palette entries, in which case the remaining entries are considered fully opaque.


8-bit PNG's can do alpha. A lot of popular tools like Photoshop however don't want to output alpha enabled 8-bit PNGs.


Couldn't they store both versions and return the better version if a tweet became popular?


This seems like YouTube feedback loops on hot videos.

Images who already have virility will be the ones in full res.


Yes, what a great feature to work on while they've spent 6+ months on restoring access to many of their earliest users[1] with nothing to show for it, and no further communication from their support.

[1] https://www.theguardian.com/technology/2018/may/31/twitter-b...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: