Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find the best PNG + Retina solution #113

Closed
feross opened this issue Feb 2, 2014 · 10 comments
Closed

Find the best PNG + Retina solution #113

feross opened this issue Feb 2, 2014 · 10 comments

Comments

@feross
Copy link

feross commented Feb 2, 2014

I want to use svg images, but due to issue #112, that's no longer an option that GitHub supports. What would it take to make the typeface in the png images look as nice as it does in the svg images?

PNG vs SVG (can't embed it due to issue #112, lol)

@espadrine
Copy link
Member

What would be really helpful is a screenshot comparison in the browsers you use most often, on your machine.

(Note, use PNG, and embed them in a comment; GitHub still authorizes that!)

@feross
Copy link
Author

feross commented Feb 2, 2014

Chrome, OS X:
screen shot 2014-02-02 at 2 24 48 pm

@espadrine
Copy link
Member

Is this a retina screen? Is the zoom at 100%?

@feross
Copy link
Author

feross commented Feb 2, 2014

Yes, retina screen. Nothing has been zoomed. Screenshots just appear 2x size because of the retina screen.

I think there might be two issues here. First, the png is not @2x. Second, the antialiasing makes the text a bit blurry and dark.

@espadrine
Copy link
Member

Unfortunately, making the image 2x is a third of the issue. Chrome (and other browsers) will render the image just as blurry; it's simply going to be twice as big. There are a few ways to tell the browser how to render it well, but those are not yet standard. Besides, some 3x screens are already coming to the market.

We can make this issue a follow-up to #102 focused on finding the best way to have PNG images on retina.

@feross
Copy link
Author

feross commented Feb 2, 2014

If you offered @2x images, one option would be to just specify a "height" inline in the HTML. It is perfectly valid to include html within a markdown document.

For example, with the following html:

<img src="image@2x.png" height="313">

I can render the retina screenshot from above at the perfect size.

The width automatically scales with the explicit height that we set. This is perfect since badges have a consistent height, but variable width. Just don't specify a width and the browser will scale it proportionally.

@feross
Copy link
Author

feross commented Feb 2, 2014

^ I think this would solve the retina problem for PNG images.

@espadrine
Copy link
Member

@feross I'll try to implement @2x next week. I recommend using SVG however, because it is super-fast to generate, super-small to send down the wire, and while GitHub has been slow to support it, they have improved quite a lot in a year. Also, 3x, an even bigger image.

@feross
Copy link
Author

feross commented Feb 2, 2014

Yep, I agree that svg is preferable. Too bad it's currently not an option due to #112. When/if that's resolved, I'll happily switch back to svg! Also, thanks for being so responsive :)

@chadwhitacre
Copy link
Contributor

#112 is resolved. I'm closing this as a duplicate of #97.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants