Hacker News new | past | comments | ask | show | jobs | submit login
Spectrum – Image transcoding library for Android or iOS (libspectrum.io)
130 points by markoa on Jan 17, 2019 | hide | past | favorite | 28 comments



Figured this is worth a note here: Squoosh is an image compression web app that allows you to dive into the advanced options provided by various image compressors. https://github.com/GoogleChromeLabs/squoosh


Looks interesting, though on recent iOS devices, images will be in HEIF format, which is about 50% the size of JPEG at similar quality, and MozJPEG isn't compatible with it afaik.

If you're interested in compressing JPEGs without quality loss, there's a free Mac app called ImageOptim that can handle JPEG, GIF and PNG. It has Google's Guetlzi, so on some JPEG you can reach 20-40% compression without any loss of quality that I could detect (and sometimes lower levels around 10% on images that are already well compressed or smaller resolution).

https://imageoptim.com/mac


50% is extremely optimistic between HEIF and a good JPEG encoder (mozjpeg/guetzli).

Guetzli usually produces very slightly better results than mozjpeg but is several hundred times slower. The 20-40% comparision is vs libjpeg.


Guetlzi comparison is mostly against JPEGs you can find in the wild (ie. from a digital camera).

In my experience, Guetzli is a lot slowly than mozjpeg, but tops up at much higher space savings when the conditions are right.


Is there a site which tracks the use of such libraries across popular apps, similar to builtwith?


Cocoapods’ website integrates with https://www.appsight.io/

It appears that it tries to do that.


Try https://nerdydata.com - lets you search by source code also


More detail about the open source here: https://code.fb.com/developer-tools/spectrum/


It's interesting to see no iOS example code in Swift.

I know that the Swift adoption rate at Facebook is low for certain reasons, but I was hoping it would go up, or at least be of concern for open sourced projects.


As someone maintaining Obj-C libraries, I can see why. Usually the Swift examples are 90% the same thing so maintaining both is just a boilerplatey hassle. And really, I expect all competent iOS developers to be able to use an Objective-C API from Swift without even thinking about it, much less require specific examples.

With that said, I do find it useful to write unit tests in Swift, just to see that the Swift API looks as expected. So that’s one way to add examples.


We write our internal demo apps for our iOS framework in Swift for this reason as well.


You can just use a Bridging Header


Nice. Anyone have experience using this?


Is there integration with React Native?


Good thing


Facebook has the worst image compression on any website, their photos are compressed to a point where they look horrible. Why would anyone want to use this?

I do not see what this benefits any developer over just using mozjpeg with better settings.


Do you really not see the benefit in avoiding the need to recreate a bunch of scaffolding around 3 separate image encoders, or is this just an excuse to dump on facebook?


libimage-magick should be sufficient, however I don't know how well that runs on androids and iphones.

It smells like a NIH project to me, but then again there might have been some very special requirements that facebook needed that was not already available in other libraries.


Does libimage-magick work at all in iOS/Android?

At Facebook's scale, the choice of whether to resize/crop/compress images on devices or at the backend must be a complete no-brainer. Why would you stand up additional datacenters instead of just burning a little more of your user's (your "product's"?) battery?


> I don't know how well that runs on androids and iphones.

Not well.


Twitter also has pretty bad compression. The worst I know of is Fandom. Reddit on the other hand has great image quality


I like how there are 2 products called Spectrum on the front page and they are completely unrelated. Anyway, this lib looks pretty ok for it's purpose.


There's also the article that wants to sell you a spectrum analyzer to search your hotel room for bugs.


GAFAS tends to never do their homework before choosing a name: they know they can roll over most previous projects and just don't care about the community as long as they can't get PR from it.


"The two hardest problems in computer science: naming things, cache invalidation, and off by one errors..."


And in the other thread, it was mentioned how the name overlap with other existing services was large.


The title should say "Android and iOS" rather than "Android or iOS", it makes more sense that way.


I'm going to make a similar library called Verizon.




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

Search: