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

Image sprites appear distorted/glitched #23

Closed
laoraryn opened this issue Oct 22, 2024 · 18 comments
Closed

Image sprites appear distorted/glitched #23

laoraryn opened this issue Oct 22, 2024 · 18 comments

Comments

@laoraryn
Copy link

Hi, I just found this and I love it! However when I try and use it, the sprites come out distorted, most similar to the Mantine in #6.

I use Black Box, but it's also happening in my default terminal. Here's some example images, both with neowofetch (running pokeshell random) and just pokeshell random on its own:

Default Linux Mint terminal:
image

image

Black Box:
image

image

Dependency versions:
image

Any ideas on what might be causing it? :/ Thanks!

@acxz
Copy link
Owner

acxz commented Oct 22, 2024

Hello @laoraryn glad you love it! I'm slowing trying to get back to fixes the issues in this project. So I apologize, if I don't get to this quickly.

I'll try to help and also point you to the relevant line, so you can can better debug and tweak the display.

First off, all of the display is handled by chafa. For the "big" sprites, which is the default for the pokeshell command, the following chafa command is executed:

chafa -w 1 --symbols all --scale 8 "${display_file}"

Now this line should provide pixel perfect display, but it isn't doing that. Most likely because the image is being resized.

Notice the --symbols all option being passed in, this is something you can change if you want. But let me first try to reproduce.

@acxz
Copy link
Owner

acxz commented Oct 22, 2024

Update: I think I found the bug, a recent commit removed the -trim option for displaying single images. Pull the latest and let me know if it resolves your issues.

image

Looks like hyfetch added some spacing since I last used it, in their ascii image mode. Doesn't look as nice as it used (i.e. the politoed example in the readme). This might be cause for an upstream issue. I double checked the image generated and not issues there.

@laoraryn
Copy link
Author

Unfortunately I'm still getting the same glitched images :(

image

Just because I'm not 100% sure I know what you recommended, here's what I did:

  1. sudo ./uninstall.sh in my old pokeshell folder
  2. Download the new .zip file from this repo
  3. sudo ./install.sh in that new folder
  4. Restart terminal

Did I need to do anything with hyfetch/Magick/chafa? I'm relatively new to messing with the terminal so I'm not sure how to do what you described.

@laoraryn
Copy link
Author

Also, no worries at all on potential slow replies! I appreciate the help :)

@acxz
Copy link
Owner

acxz commented Oct 25, 2024

Ah thanks for reporting back, I'd first make sure that you are removing the cache pokeshell -r. (I might make this a part of the uninstall script to be honest)
But if you are using pokeshell random, then those images wouldn't have been cached anyway...

image

This might be something to investigate. What's your imagemagick version? It could be an older version of magick that doesn't support how I'm currently using imagemagick. I don't remember the command to check the version off the cuff. Maybe something like magick --version? You might have to search the web to make sure that is correct.

@Cloudismss
Copy link

I'm having the same issue as above. Clearing the cache with pokeshell -r hasn't changed the results .

image

My ImageMagick version is 7.1.1-39 if that is helpful!

@laoraryn
Copy link
Author

I'm also using 7.1.1-39! Clearing the cache didn't help. But also, the random Pokemon ARE being cached for me - after running pokeshell -r, I ran random 3 times:
image

(I also installed the Starship prompt with my other "oooh shiny new OS" tinkering, which is why it looks different, but that doesn't seem to have made a difference)

@acxz
Copy link
Owner

acxz commented Oct 26, 2024

starship is p nice! I've been meaning it to give it a go!

Okay so I updated uninstall to clear the cache
and I am not using the PNG: syntax in magick anymore, this should get rid of that warning you guys are experiencing on your version of magick and that should result in the images being trimmed and hence proper high res pixelated images being shown.

Some more info: my magick version is the same, but is built with the png delegate which means I don't see the error. (I'm on Arch Linux), while looking at your output, I see that you only have zlib delegate.

Please download/clone the repo again, uninstall, install, and then try again.

Do let me know if the issue is fixed for you guys. If the issue still persists, we will take a look at chafa next. I'm on version 1.14.2, while you seem to be on 1.14.0.

@Cloudismss
Copy link

I ran uninstall.sh, cloned and ran install.sh, but I'm unfortunately still getting the same distorted result. Can confirm the magick deprecated command error is gone tho! My chafa is version 1.14.2

@acxz
Copy link
Owner

acxz commented Oct 26, 2024

can you post an image of your output?

@Cloudismss
Copy link

Yes, this is the entire output from pokeshell -a piplup (this image was not cached beforehand)

image

@Cloudismss
Copy link

Maybe this will be helpful - the -b flag seems to be no different from the call without -b flag

image

@laoraryn
Copy link
Author

unfortunately I'm still getting the PNG error. I'm not sure if I screwed something up - I had to reinstall Magick and Chafa also, so I'm not sure if I could've knocked something loose while doing that. They're still the same versions as they were before

Here's the output for me as of all the fresh installs. It looks slightly better than before, but still distorted:
image

@acxz
Copy link
Owner

acxz commented Oct 26, 2024

Maybe this will be helpful - the -b flag seems to be no different from the call without -b flag

@Cloudismss please read pokeshell -h, -b/--big is the default behavior.

@acxz
Copy link
Owner

acxz commented Oct 27, 2024

Yes, this is the entire output from pokeshell -a piplup (this image was not cached beforehand)

For the animations, see #13. This issue is for images only.

@acxz acxz changed the title Sprites appear distorted/glitched Image sprites appear distorted/glitched Oct 27, 2024
@acxz
Copy link
Owner

acxz commented Oct 27, 2024

unfortunately I'm still getting the PNG error. I'm not sure if I screwed something up - I had to reinstall Magick and Chafa also, so I'm not sure if I could've knocked something loose while doing that. They're still the same versions as they were before

The reinstallation shouldn't be an issue at all. But what is an issue is the fact you still have that warning. Let's work on getting rid of that.

Can you first try to open up the bin/imageshell/imageshell.sh in a text editor and search for PNG? Let me know if that search is successful. If the search passes then you have an outdated pokeshell codebase and you'll have to redownload. If the search fails, then we may have to see what we can do about the delegates your magick install supports (as seen from your magick --version output).

@acxz
Copy link
Owner

acxz commented Oct 27, 2024

Note if you want pixel perfect images (useful for the -s small and -b big sprites), install timg. See: hpjansson/chafa#70 if you want to dig deeper.

@acxz
Copy link
Owner

acxz commented Nov 10, 2024

@laoraryn any updates? I'll go ahead and close this issue due to lack of activity, but please feel free to comment on this issue with responses to my above comments.

@acxz acxz closed this as completed Nov 10, 2024
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