I am using QGraphicsView/QGraphicsScene framework to display an HD image (and some overlaying items). Image will appear scaled down but I need the full resolution as the user is able to zoom in to parts of the image.
I need to apply some simple filters to the image like display the Red channel. How can I apply the filters to only the visible part of the image? For example if the original image size is 1920x1080 displayed scaled down to 720x480 I want to apply the filter only to the 720x480 image.
This will greatly reduce the CPU cycles used to apply filters.
Related
Is it possible using only CSS to replicate how as screen sizes change but the same amount of image is seen? I have been able to scale the image but the amount of the image seen changes as screen sizes change. I am fairly new to learning CSS and appreciate any help.
I am trying to replicate this site. Just the initial section and first image.
https://ayesha.dropletthemes.com/home-beauty-salon/
I'm designing a website which uses a SVG-document as background. I want this image to tile on the X-axis. Which works great, but I wanted to know if it is possible to show one group in the SVG only once, such that in subsequent tiles the group is hidden.
The above image visualizes what I want to achieve. The image having one group (in the image the red circle) that is invisible in the following tiles.
Now I am aware such things can be achieved using additional CSS backgrounds but I am really interested if such thing could be achieved using a single SVG background.
Thanks in advance!
The answer is no. If you are relying on CSS to tile the background - ie. with repeat-x, then no. there isn't any way to do what you want. When an SVG is used as a background like that, it becomes immutable - effectively the same as a PNG or a JPEG.
You will need to use a different method.
I'm trying to create a bootstrap gallery with the thumbnail component. I pulled the code directly from getboostrap.
When viewing the page at full size everything looks fine. However, when I resize the screen to make it smaller the images don't adjust to fit inside of the thumbnail box. What I was hoping to do is have an image that adjusts in size based on how wide the thumbnail box is.
Instead the thumbnail box ends up being substantially wider than the image itself, especially on medium sized screens. The images I'm using for my source images are more than large enough to take up the entire space within the thumbnail.
Any ideas?
Thanks
Look at the Google homepage being displayed right at this moment. A screenshot is provided below.
Instead of using this as a single image Google used css sprite. The sprite image
is provided below (dimension changed):
Question is why css sprite was used instead of a single image ? If a single image was used then wouldn't the number of HTTP requests be same as in this css sprite case ?
A single image would not allow for (different) hover effects in different areas.
Or you would have to load an image of the same size for each animation. By using a sprite, you just have to load the image once and all animations run with that data.
CSS sprites are a way to reduce the number of HTTP requests made for image resources referenced by your site. Images are combined into one larger image at defined X and Y coordinates.
Having assigned this generated image to relevant page elements the background-position CSS property can then be used to shift the visible area to the required component image.
I am trying to implement a fixed background for a website like one over here. Searching around for it told me that I can use background: fixed or background-attachment properties for this.
My problem is the image which will be used as background. I am thinking about following issues:
What should be image size?
how will it repeat when browser window size is very large? for big 27" monitors out there?
Can somebody guide me on these points?
Regards
Vikram
That is not a single background image. Its mostly a bgcolor, except for the side clouds. Using a single large image as a background will dramatically slow down your load time.
There's no specific guideline. You need to make the image as large as necessary to satisfy the requirements of the design. If you want someone with a maximized browser window on a 30-inch display to see a single unbroken non-repeating background image, then yes, you'll need quite a large image. It won't perform well.
The Twitter example is a wide but short image, set to repeat along its x-axis. It's wide at 2247 pixels, but perhaps unnecessarily so: it actually appears to be a fixed pattern that repeats horizontally four times within that 2247 pixel image. Nonetheless, you get the idea: make an image that blends gracefully into itself at its edges for seamless tiling, and/or blends into a fixed background color. Position and repeat it as needed, set the background-color of the page, and you're done.