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

Ability to select fit size / wallpaper mode #89

Closed
DragonJTS opened this issue Oct 8, 2018 · 20 comments
Closed

Ability to select fit size / wallpaper mode #89

DragonJTS opened this issue Oct 8, 2018 · 20 comments

Comments

@DragonJTS
Copy link

DragonJTS commented Oct 8, 2018

Such as stretch, center to screen, etc, instead of everything being fill the DE default

@pauloalves86
Copy link

pauloalves86 commented Oct 30, 2018

Try adding a new filter. Add the following line to ~/.config/variety/variety.conf:

filter9 = True|Smart Fit|-resize 1920x1080^ -gravity center -extent 1920x1080 -blur 0x10 -clone 0 -resize 1920x1080 -size 1920x1080 -gravity center -composite

@peterlevi and @jlu5 could this filter become native?

@jlu5
Copy link
Member

jlu5 commented Oct 30, 2018

@pauloalves86 AFAIK the intention of this issue is to eventually add abstraction so that we can switch between wallpaper modes provided by a DE instead of modifying the image ourselves.

@jlu5 jlu5 changed the title Feature Request: ability to select fit size Ability to select fit size / wallpaper mode Oct 30, 2018
@pauloalves86
Copy link

Sorry, I misunderstood, but do you think this Smart Fit worth an issue?

@jlu5
Copy link
Member

jlu5 commented Apr 17, 2019

Related: #96 (comment)

See related bugs on the Launchpad tracker:
https://bugs.launchpad.net/variety/+bug/1132140
https://bugs.launchpad.net/variety/+bug/1160603
https://bugs.launchpad.net/variety/+bug/1096035

The biggest obstacle to multi-monitor support is that it's complicated. We don't yet have the abstraction to deal with multiple wallpapers / setting wallpaper modes, and a proper multi-monitor implementation would certainly require those. If you're interested in span, maybe try the workaround posted at https://bugs.launchpad.net/variety/+bug/1132140/comments/5

@mystiquewolf
Copy link

mystiquewolf commented Apr 25, 2020

Just so this can really be visible in the active issue - repeat image would also be a nice addition to the other wallpaper modes. The difference between the following two images is miles away:
Eiffel Tower not repeated

Eiffel Tower repeated

Also it would be really nice that once able to display images in certain mode, actually be able to associate one image with one mode, other image with a different mode, so that we have a default mode and an associated with image/overriding modes. Not all images might need to be repeated.

@dbkaynor
Copy link

dbkaynor commented May 1, 2020

I use imagemagik to fit my images to the screen. The code goes into the script directory. Ì will post the code if anyone asks.

@jazz-it
Copy link

jazz-it commented May 1, 2020

I use imagemagik to fit my images to the screen. The code goes into the script directory. Ì will post the code if anyone asks.

Please post the code with a description, or working examples.

@mystiquewolf
Copy link

I use imagemagik to fit my images to the screen. The code goes into the script directory. Ì will post the code if anyone asks.

I doubt images will not look blurry if they are in portrait mode, so repeat image would still be good IMO.

@dbkaynor
Copy link

dbkaynor commented May 3, 2020

/usr/bin/mogrify -resize 1400x800 $WP
/usr/bin/mogrify -font helvetica -fill white -pointsize 20 -gravity center -draw "text 0,300 '$3'" $WP

Notes:
The lines go after the WP=$1 line.
The first line sets the size and the second line puts the file path and name on the wallpaper.
Either line may be commented out or modified as needed.
The resize line will need to be adjusted to your monitor size. I have two monitors and I set it to the size of the smaller one.

I use the following code for debugging:

WP=$1

echo $1 > ~/Desktop/VarietyOut.txt
echo $2 >> ~/Desktop/VarietyOut.txt
echo $3 >> ~/Desktop/VarietyOut.txt

echo "$!" >> ~/Desktop/VarietyOut.txt

echo "!!! /usr/bin/identify $1 1 " >> ~/Desktop/VarietyOut.txt
/usr/bin/identify $1 >> ~/Desktop/VarietyOut.txt

echo "!!! /usr/bin/identify WP " >> ~/Desktop/VarietyOut.txt
/usr/bin/identify $WP >> ~/Desktop/VarietyOut.txt

echo "!!! /usr/bin/mogrify -resize 1400x800 WP" >> ~/Desktop/
/usr/bin/mogrify -resize 1400x800 $WP

echo "!!! /usr/bin/mogrify -font helv" >> ~/Desktop/
/usr/bin/mogrify -font helvetica -fill white -pointsize 20 -gravity center -draw "text 0,300 '$3'" $WP

echo "!!! /usr/bin/identify WP " >> ~/Desktop/VarietyOut.txt
/usr/bin/identify $WP >> ~/Desktop/VarietyOut.txt

echo $WP >> ~/Desktop/VarietyOut.txt
echo "--------------------------" >> ~/Desktop/VarietyOut.txt

@dbkaynor
Copy link

dbkaynor commented May 3, 2020 via email

@xenzirril
Copy link

xenzirril commented Jun 15, 2020

Try adding a new filter. Add the following line to ~/.config/variety/variety.conf:

filter9 = True|Smart Fit|-resize 1920x1080^ -gravity center -extent 1920x1080 -blur 0x10 -clone 0 -resize 1920x1080 -size 1920x1080 -gravity center -composite

@peterlevi and @jlu5 could this filter become native?

THIS!!! It fixed my particular display challenge and completely changed my experience with the program.

Will post my hardware spec, if req'd. But its basically HP All-in-one Touch with int NVidia Geforce 9600M GS, running Ubuntu 20.04 @ 1600x1200 (to which I edited the line to match my reqs). Not your typical setup.

So good now, I'm donating!

@harpetersen
Copy link

[Just donated] It'd be nice if there was a button to auto-fit vs fill vs original-size that could be applied before the filters, rather than having to go in and add the resizing to all the images manually.

@realkotob
Copy link

realkotob commented Aug 10, 2020

Try adding a new filter. Add the following line to ~/.config/variety/variety.conf:

filter9 = True|Smart Fit|-resize 1920x1080^ -gravity center -extent 1920x1080 -blur 0x10 -clone 0 -resize 1920x1080 -size 1920x1080 -gravity center -composite

peterlevi and jlu5 could this filter become native?

I just found this after suffering for a while, it helped immensely.

Is there interest to make this filter built-in? I can make a PR if so.

@jlu5 jlu5 unpinned this issue Oct 15, 2020
@ChrisKeefe
Copy link

@peterlevi, thanks for putting together such an awesome tool. I'm just writing to bump this issue.

I came here looking for a way to center and upsize images without any cropping/overflow, so that wallpapers with various aspect ratios can be displayed without loss of image content.

A quick search shows many related issues (1, 2, 3, 4, 5, 6, 7, ...). The patch suggested above (creating additional ImageMagick filters) isn't perfect, but it mostly does the job; the major hangups seem to be the fact that filters are applied randomly, and .... learning ImageMagick.

I suspect that including image resizing, tiling, stretching, etc (the most common wallpaper choices) would make display much more consistent, and could make this the one true wallpaper manager for a lot of people who want something that "just works", especially on DEs that don't provide good wallpaper support. In the meantime, though, if anyone has ImageMagick "filters" that effectively tile, center an image on a black background without cropping, etc, this issue might be a nice place for them.

@ChrisKeefe
Copy link

@pauloalves86 , you seem to have a grasp on the filter situation here. This ImageMagick script does what I want it to do from the command line (exactly like your filter, but with flat black instead of blurred image borders):
magick convert image.jpg -resize 1920x1080\> -size 1920x1080 xc:black +swap -gravity center -composite image_fit.jpg

This filter doesn't produce similar results:
filter9 = True|Not So Smart|-resize 1920x1080\> -size 1920x1080 xc:black +swap -gravity center -composite

Any idea what I'm missing here?

@pauloalves86
Copy link

I'm not running Linux right now, so I can not test, but have you tried to not escape >?

@racompton
Copy link

What would the filter be to zoom the image in so that it fills in the entire screen (no image borders)?

@pauloalves86
Copy link

@racompton -resize 1920x1080^
This resizes the image to have the smallest edge matches the required size.

@ChrisKeefe
Copy link

ChrisKeefe commented Jan 12, 2021

Interestingly, the filter @pauloalves86 tried to help me troubleshoot is now working as initially proposed. (Thank you!) I wonder whether the initial failure was caused by my changes being overwritten by cached settings, because I was editing the filter while Variety was open.

This filter fits images to screen without cropping, and borders with black as needed.
filter9 = True|Center on black|-resize 1920x1080\> -size 1920x1080 xc:black +swap -gravity center -composite

Examples

Image aspect matches monitor

Screenshot from 2021-01-12 13-54-59

Image aspect wider than monitor

Screenshot from 2021-01-12 13-49-03

Image aspect taller than monitor

Screenshot from 2021-01-12 13-48-34

These gorgeous images (1, 2, 3) are all freely available under the Unsplash license.

@racompton
Copy link

racompton commented Jan 12, 2021

FYI, this is what I wanted. I wanted to fill the screen with the image and crop it if it wouldn't fit. I didn't like the borders on the sides that other filters would generate:
filter9= True|Fill Screen|-resize 1920x1080^ -gravity center -extent 1920x1080

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

No branches or pull requests