This study investigates the emotions portrayed in immigration-related visual media across multiple countries and their link to socioeconomic contexts. The analysis examines how socioeconomic factors like perceived corruption, GDP per capita, and income inequality predict the average emotional information conveyed in images associated with immigrants. Computer vision has been employed to analyze the emotional content in media images related to immigrants. Images were sampled from various online media outlets in 45 countries. Results indicate that socioeconomic indexes, especially corruption scores and GDP per capita, significantly predict the emotional content of media images related to immigrants. Specifically, higher perceived corruption and lower GDP per capita are associated with increased negative emotions in visual content. Further, a mediation analysis suggests those factors mediate the relationship between income inequality and emotional information in images. The analysis also considers gender differences, showing that emotions in images linked to immigrant men are more negative than those associated with women. These results align with theories indicating that higher perceived competition for resources due to inequality or scarcity can translate into immigrants being seen as threatening out-groups. The study underscores the link between societal factors and emotions in immigration-related visual media and the possibility of employing artificial intelligence techniques to measure it. Emotions in images associated with a given group, such as immigrants, can shape and reflect discourses about them in a given society; understanding how the context shapes these discourses can inform strategies to address the potential impact these discourses can have on immigrants and society.