It's actually a very low resoluton image (3x7 by default), stretched using the bilinear filtering provided by the browser.
Chrome and Safari produce smooth images. Firefox for Mac produces a mosaic (source each pixel gets a ~10x10 grid, it looks pretty good IMO). Firfox for Android may not do any smoothing. I don't think there's a way to control how the browser does the filtering.
The gradients look nice, but a nitpick about the site: Alt+LeftArrow and Alt+RightArrow are hijacked by the site to scroll! This is a shortcut for back/forward in browser history, and apparently I use it without thinking, because I just had a rather jarring experience trying to get back to the HN comments page.
Good job on this- very cool. I think it'd be a nice addition to have a "randomize settings" button, or perhaps allow a "travel" mode where the x/y positions change in smaller increments (so the background changes a bit slower).
The x/y increment resolution is a limit of the technique used. It uses overzoomed images, you scroll one source pixel at a time. Since it uses `background-size: cover;` for rendering, you cant scroll by fractions of pixels.
Ah, that makes sense. I thought it was just that the dat.gui step was set to '1' not '0.01'. Didn't realize the step was set that way puposely due to a limitation of the technique being used.
I just noticed that :) Was working on adding a randomize button, but having trouble building. Are you using gulp or webpack or a combination?
I'll submit a PR after editing this (if you wanna accept it): https://github.com/tiborsaas/unique-gradient-generator/blob/... Trying to add a randomize() function that edits topX, topY, and sampleArea. Might add a button to dat.gui or maybe just call it based on pressing the 'r' key.
I've read about that before, so there's a chance it planted a seed in my brain, but the idea for the tool came from a codepen experiment I did a few months ago.
Comments (94) 40 threads
Earlier commentsI always thought the staff had, for some reason, decided that mobile users didn't need to know which comment was part of which thread.
Chrome and Safari produce smooth images. Firefox for Mac produces a mosaic (source each pixel gets a ~10x10 grid, it looks pretty good IMO). Firfox for Android may not do any smoothing.
I don't think there's a way to control how the browser does the filtering.
https://css-tricks.com/almanac/properties/i/image-rendering/
I'd like to add something like this to: http://projects.skratchdot.com/infinite-gradients
I'll at least add a link to https://github.com/tiborsaas/unique-gradient-generator in the README...
Readme will improve and I'll certainly link to your project, I like it a lot.
I'll submit a PR after editing this (if you wanna accept it): https://github.com/tiborsaas/unique-gradient-generator/blob/...
Trying to add a randomize() function that edits topX, topY, and sampleArea. Might add a button to dat.gui or maybe just call it based on pressing the 'r' key.
All comments shown.
Couldn't load more comments. Check your connection and try again.